Google App Engine Domain Mapping
This page shows how to write Terraform for App Engine Domain Mapping and write them securely.
google_app_engine_domain_mapping (Terraform)
The Domain Mapping in App Engine can be configured in Terraform with the resource name google_app_engine_domain_mapping
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_app_engine_domain_mapping" "domain_mapping" {
domain_name = "verified-domain.com"
ssl_settings {
ssl_management_type = "AUTOMATIC"
}
resource "google_app_engine_domain_mapping" "domain_mapping" {
domain_name = "verified-domain.com"
ssl_settings {
ssl_management_type = "AUTOMATIC"
}
resource "google_app_engine_domain_mapping" "domain_mapping" {
count = length(var.domain_mapping)
domain_name = lookup(var.domain_mapping[count.index], "domain_name")
project = var.project
override_strategy = lookup(var.domain_mapping[count.index], "override_strategy", "OVERRIDE")
resource "google_app_engine_domain_mapping" "domain_mapping" {
domain_name = "verified-domain.com"
override_strategy = "DEFAULT"
ssl_settings {
ssl_management_type = "AUTOMATIC"
resource "google_app_engine_domain_mapping" "domain_mapping" {
domain_name = var.domain_name
dynamic "ssl_settings" {
for_each = var.ssl_settings[*]
content {
certificate_id = ssl_settings.value.certificate_id
Parameters
-
domain_name
required - string
Relative name of the domain serving the application. Example: example.com.
Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.
-
override_strategy
optional - string
Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. Default value: "STRICT" Possible values: ["STRICT", "OVERRIDE"]
-
project
optional computed - string -
resource_records
optional computed - list of object
The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping.
-
name
- string -
rrdata
- string -
type
- string -
ssl_settings
list block-
certificate_id
optional computed - string
ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support. By default, a managed certificate is automatically created for every domain mapping. To omit SSL support or to configure SSL manually, specify 'SslManagementType.MANUAL' on a 'CREATE' or 'UPDATE' request. You must be authorized to administer the 'AuthorizedCertificate' resource to manually map it to a DomainMapping resource. Example: 12345.
-
pending_managed_certificate_id
optional computed - string
ID of the managed 'AuthorizedCertificate' resource currently being provisioned, if applicable. Until the new managed certificate has been successfully provisioned, the previous SSL state will be preserved. Once the provisioning process completes, the 'certificateId' field will reflect the new managed certificate and this field will be left empty. To remove SSL support while there is still a pending managed certificate, clear the 'certificateId' field with an update request.
-
ssl_management_type
required - string
SSL management type for this domain. If 'AUTOMATIC', a managed certificate is automatically provisioned. If 'MANUAL', 'certificateId' must be manually specified in order to configure SSL for this domain. Possible values: ["AUTOMATIC", "MANUAL"]
-
-
timeouts
single block
Explanation in Terraform Registry
A domain serving an App Engine application. To get more information about DomainMapping, see:
- API documentation
- How-to Guides
Frequently asked questions
What is Google App Engine Domain Mapping?
Google App Engine Domain Mapping is a resource for App Engine of Google Cloud Platform. Settings can be wrote in Terraform.
Where can I find the example code for the Google App Engine Domain Mapping?
For Terraform, the reubanj/GCP-terraform, yaroslavopsguru/gcp-tf-resources and mikamakusa/terraform source code examples are useful. See the Terraform Example section for further details.