azurermNginxConfiguration
Manages the configuration for a Nginx Deployment.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.nginxConfiguration.NginxConfiguration(this, "test", {
config_file: [
{
content:
"${base64encode(<<-EOT\nhttp {\n server {\n listen 80;\n location / {\n default_type text/html;\n return 200 '<!doctype html><html lang=\"en\"><head></head><body>\n <div>this one will be updated</div>\n <div>at 10:38 am</div>\n </body></html>';\n }\n include site/*.conf;\n }\n}\nEOT\n )}",
virtual_path: "/etc/nginx/nginx.conf",
},
{
content:
"${base64encode(<<-EOT\nlocation /bbb {\n default_type text/html;\n return 200 '<!doctype html><html lang=\"en\"><head></head><body>\n <div>this one will be updated</div>\n <div>at 10:38 am</div>\n </body></html>';\n}\nEOT\n )}",
virtual_path: "/etc/nginx/site/b.conf",
},
],
nginx_deployment_id: "${azurerm_nginx_deployment.test.id}",
root_file: "/etc/nginx/nginx.conf",
});
Arguments Reference
The following arguments are supported:
-
nginxDeploymentId
- (Required) The ID of the Nginx Deployment. Changing this forces a new Nginx Configuration to be created. -
rootFile
- (Required) Specify the root file path of this Nginx Configuration.
-> NOTE: Either packageData
or configFile
must be specified - but not both.
-
packageData
- (Optional) Specify the package data for this configuration. -
configFile
- (Optional) One or moreconfigFile
blocks as defined below. -
protectedFile
- (Optional) One or moreprotectedFile
(Protected File) blocks with sensitive information as defined below. If specifiedconfigFile
must also be specified.
A configFile
block supports the following:
-
content
- (Required) Specifies the base-64 encoded contents of this config file. -
virtualPath
- (Required) Specify the path of this config file.
A protectedFile
(Protected File) block supports the following:
-
content
- (Required) Specifies the base-64 encoded contents of this config file (Sensitive). -
virtualPath
- (Required) Specify the path of this config file.
Attributes Reference
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of this Nginx Configuration.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Nginx Configuration.read
- (Defaults to 5 minutes) Used when retrieving the Nginx Configuration.update
- (Defaults to 10 minutes) Used when updating the Nginx Configuration.delete
- (Defaults to 10 minutes) Used when deleting the Nginx Configuration.
Import
Nginxs can be imported using the resourceId
, e.g.