pulumi-django-azure 1.0.9__py3-none-any.whl → 1.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulumi-django-azure might be problematic. Click here for more details.
- pulumi_django_azure/django_deployment.py +22 -3
- {pulumi_django_azure-1.0.9.dist-info → pulumi_django_azure-1.0.11.dist-info}/METADATA +13 -1
- pulumi_django_azure-1.0.11.dist-info/RECORD +7 -0
- pulumi_django_azure-1.0.9.dist-info/RECORD +0 -7
- {pulumi_django_azure-1.0.9.dist-info → pulumi_django_azure-1.0.11.dist-info}/LICENSE +0 -0
- {pulumi_django_azure-1.0.9.dist-info → pulumi_django_azure-1.0.11.dist-info}/WHEEL +0 -0
- {pulumi_django_azure-1.0.9.dist-info → pulumi_django_azure-1.0.11.dist-info}/top_level.txt +0 -0
|
@@ -95,7 +95,7 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
95
95
|
"""
|
|
96
96
|
|
|
97
97
|
# Put CDN in front
|
|
98
|
-
|
|
98
|
+
self._cdn_profile = azure.cdn.Profile(
|
|
99
99
|
f"cdn-{self._name}",
|
|
100
100
|
resource_group_name=self._rg,
|
|
101
101
|
location="global",
|
|
@@ -125,7 +125,7 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
125
125
|
],
|
|
126
126
|
is_http_allowed=False,
|
|
127
127
|
is_https_allowed=True,
|
|
128
|
-
profile_name=
|
|
128
|
+
profile_name=self._cdn_profile.name,
|
|
129
129
|
origin_host_header=endpoint_origin,
|
|
130
130
|
origins=[azure.cdn.DeepCreatedOriginArgs(name="origin-storage", host_name=endpoint_origin)],
|
|
131
131
|
query_string_caching_behavior=azure.cdn.QueryStringCachingBehavior.IGNORE_QUERY_STRING,
|
|
@@ -138,7 +138,7 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
138
138
|
azure.cdn.CustomDomain(
|
|
139
139
|
f"cdn-custom-domain-{self._name}",
|
|
140
140
|
resource_group_name=self._rg,
|
|
141
|
-
profile_name=
|
|
141
|
+
profile_name=self._cdn_profile.name,
|
|
142
142
|
endpoint_name=self._cdn_endpoint.name,
|
|
143
143
|
host_name=custom_host,
|
|
144
144
|
)
|
|
@@ -577,6 +577,7 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
577
577
|
),
|
|
578
578
|
https_only=True,
|
|
579
579
|
site_config=azure.web.SiteConfigArgs(
|
|
580
|
+
app_command_line="cicd/startup.sh",
|
|
580
581
|
always_on=True,
|
|
581
582
|
health_check_path=self.HEALTH_CHECK_PATH,
|
|
582
583
|
ftps_state=azure.web.FtpsState.DISABLED,
|
|
@@ -603,6 +604,8 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
603
604
|
azure.web.NameValuePairArgs(name="AZURE_STORAGE_CONTAINER_MEDIA", value=media_container.name),
|
|
604
605
|
# CDN
|
|
605
606
|
azure.web.NameValuePairArgs(name="CDN_HOST", value=self._cdn_host),
|
|
607
|
+
azure.web.NameValuePairArgs(name="CDN_PROFILE", value=self._cdn_profile.name),
|
|
608
|
+
azure.web.NameValuePairArgs(name="CDN_ENDPOINT", value=self._cdn_endpoint.name),
|
|
606
609
|
# Database settings
|
|
607
610
|
azure.web.NameValuePairArgs(name="DB_HOST", value=self._pgsql.fully_qualified_domain_name),
|
|
608
611
|
azure.web.NameValuePairArgs(name="DB_NAME", value=db.name),
|
|
@@ -694,6 +697,22 @@ class DjangoDeployment(pulumi.ComponentResource):
|
|
|
694
697
|
scope=comms.id,
|
|
695
698
|
)
|
|
696
699
|
|
|
700
|
+
# Grant the app to purge the CDN endpoint
|
|
701
|
+
cdn_role = self._cdn_endpoint.id.apply(
|
|
702
|
+
lambda scope: azure.authorization.get_role_definition(
|
|
703
|
+
role_definition_id="/426e0c7f-0c7e-4658-b36f-ff54d6c29b45",
|
|
704
|
+
scope=scope,
|
|
705
|
+
)
|
|
706
|
+
)
|
|
707
|
+
|
|
708
|
+
azure.authorization.RoleAssignment(
|
|
709
|
+
f"ra-{name}-cdn",
|
|
710
|
+
principal_id=principal_id,
|
|
711
|
+
principal_type=azure.authorization.PrincipalType.SERVICE_PRINCIPAL,
|
|
712
|
+
role_definition_id=cdn_role.id,
|
|
713
|
+
scope=self._cdn_endpoint.id,
|
|
714
|
+
)
|
|
715
|
+
|
|
697
716
|
# Create a CORS rules for this website
|
|
698
717
|
if website_hosts:
|
|
699
718
|
origins = [f"https://{host}" for host in website_hosts]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pulumi-django-azure
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: Simply deployment of Django on Azure with Pulumi
|
|
5
5
|
Author-email: Maarten Ureel <maarten@youreal.eu>
|
|
6
6
|
License: MIT License
|
|
@@ -50,6 +50,18 @@ To have a proper and secure environment, we need these components:
|
|
|
50
50
|
* Azure Key Vault per application
|
|
51
51
|
* Webapp running pgAdmin
|
|
52
52
|
|
|
53
|
+
## Project requirements
|
|
54
|
+
Your Django project should contain a folder `cicd` with these files:
|
|
55
|
+
* pre_build.sh: commands to be executed before building the application, for example NPM install, CSS build commands,...
|
|
56
|
+
* post_build.sh: commands to be executed after building the application, e.g. cleaning up.
|
|
57
|
+
Note that this runs in the identity of the build container, so you should not run database or storage manipulations here.
|
|
58
|
+
* startup.sh: commands to run the actual application. I recommend to put at least:
|
|
59
|
+
```bash
|
|
60
|
+
python manage.py migrate
|
|
61
|
+
python manage.py collectstatic --noinput
|
|
62
|
+
gunicorn --timeout 600 --workers $((($NUM_CORES*2)+1)) --chdir $APP_PATH yourapplication.wsgi --access-logfile '-' --error-logfile '-'
|
|
63
|
+
```
|
|
64
|
+
Be sure to change `yourapplication` in the above.
|
|
53
65
|
## Installation
|
|
54
66
|
This package is published on PyPi, so you can just add pulumi-django-azure to your requirements file.
|
|
55
67
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pulumi_django_azure/__init__.py,sha256=tXTvPfr8-Nll5cjMyY9yj_0z_PQ0XAcxihzHRCES-hU,63
|
|
2
|
+
pulumi_django_azure/django_deployment.py,sha256=A9TfLxTDeag0cFyZEI0Lk_I32CSY-5D5qZdjxFynto4,31119
|
|
3
|
+
pulumi_django_azure-1.0.11.dist-info/LICENSE,sha256=NX2LN3U319Zaac8b7ZgfNOco_nTBbN531X_M_13niSg,1087
|
|
4
|
+
pulumi_django_azure-1.0.11.dist-info/METADATA,sha256=dYzfdMqDAcwtkHdTmBh0OFrHfVIxidJL6sZM5xCvJRM,11083
|
|
5
|
+
pulumi_django_azure-1.0.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
6
|
+
pulumi_django_azure-1.0.11.dist-info/top_level.txt,sha256=MNPRJhq-_G8EMCHRkjdcb_xrqzOkmKogXUGV7Ysz3g0,20
|
|
7
|
+
pulumi_django_azure-1.0.11.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pulumi_django_azure/__init__.py,sha256=tXTvPfr8-Nll5cjMyY9yj_0z_PQ0XAcxihzHRCES-hU,63
|
|
2
|
-
pulumi_django_azure/django_deployment.py,sha256=gqdrUq7dLO7ds4OmZt5X-UKEO328ZlxsFTqA97UiSFo,30222
|
|
3
|
-
pulumi_django_azure-1.0.9.dist-info/LICENSE,sha256=NX2LN3U319Zaac8b7ZgfNOco_nTBbN531X_M_13niSg,1087
|
|
4
|
-
pulumi_django_azure-1.0.9.dist-info/METADATA,sha256=3-xSB9Kfhrwn2yWW7KOsVQsJuNMyl2fDU3c02SttWcY,10283
|
|
5
|
-
pulumi_django_azure-1.0.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
6
|
-
pulumi_django_azure-1.0.9.dist-info/top_level.txt,sha256=MNPRJhq-_G8EMCHRkjdcb_xrqzOkmKogXUGV7Ysz3g0,20
|
|
7
|
-
pulumi_django_azure-1.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|