aws.apprunner.CustomDomainAssociation
Explore with Pulumi AI
Manages an App Runner Custom Domain association.
NOTE: After creation, you must use the information in the
certification_validation_records
attribute to add CNAME records to your Domain Name System (DNS). For each mapped domain name, add a mapping to the target App Runner subdomain (found in thedns_target
attribute) and one or more certificate validation records. App Runner then performs DNS validation to verify that you own or control the domain name you associated. App Runner tracks domain validity in a certificate stored in AWS Certificate Manager (ACM).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.apprunner.CustomDomainAssociation("example", {
domainName: "example.com",
serviceArn: exampleAwsApprunnerService.arn,
});
import pulumi
import pulumi_aws as aws
example = aws.apprunner.CustomDomainAssociation("example",
domain_name="example.com",
service_arn=example_aws_apprunner_service["arn"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apprunner"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apprunner.NewCustomDomainAssociation(ctx, "example", &apprunner.CustomDomainAssociationArgs{
DomainName: pulumi.String("example.com"),
ServiceArn: pulumi.Any(exampleAwsApprunnerService.Arn),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppRunner.CustomDomainAssociation("example", new()
{
DomainName = "example.com",
ServiceArn = exampleAwsApprunnerService.Arn,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apprunner.CustomDomainAssociation;
import com.pulumi.aws.apprunner.CustomDomainAssociationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CustomDomainAssociation("example", CustomDomainAssociationArgs.builder()
.domainName("example.com")
.serviceArn(exampleAwsApprunnerService.arn())
.build());
}
}
resources:
example:
type: aws:apprunner:CustomDomainAssociation
properties:
domainName: example.com
serviceArn: ${exampleAwsApprunnerService.arn}
Create CustomDomainAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CustomDomainAssociation(name: string, args: CustomDomainAssociationArgs, opts?: CustomResourceOptions);
@overload
def CustomDomainAssociation(resource_name: str,
args: CustomDomainAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CustomDomainAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain_name: Optional[str] = None,
service_arn: Optional[str] = None,
enable_www_subdomain: Optional[bool] = None)
func NewCustomDomainAssociation(ctx *Context, name string, args CustomDomainAssociationArgs, opts ...ResourceOption) (*CustomDomainAssociation, error)
public CustomDomainAssociation(string name, CustomDomainAssociationArgs args, CustomResourceOptions? opts = null)
public CustomDomainAssociation(String name, CustomDomainAssociationArgs args)
public CustomDomainAssociation(String name, CustomDomainAssociationArgs args, CustomResourceOptions options)
type: aws:apprunner:CustomDomainAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CustomDomainAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CustomDomainAssociationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CustomDomainAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CustomDomainAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CustomDomainAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var customDomainAssociationResource = new Aws.AppRunner.CustomDomainAssociation("customDomainAssociationResource", new()
{
DomainName = "string",
ServiceArn = "string",
EnableWwwSubdomain = false,
});
example, err := apprunner.NewCustomDomainAssociation(ctx, "customDomainAssociationResource", &apprunner.CustomDomainAssociationArgs{
DomainName: pulumi.String("string"),
ServiceArn: pulumi.String("string"),
EnableWwwSubdomain: pulumi.Bool(false),
})
var customDomainAssociationResource = new CustomDomainAssociation("customDomainAssociationResource", CustomDomainAssociationArgs.builder()
.domainName("string")
.serviceArn("string")
.enableWwwSubdomain(false)
.build());
custom_domain_association_resource = aws.apprunner.CustomDomainAssociation("customDomainAssociationResource",
domain_name="string",
service_arn="string",
enable_www_subdomain=False)
const customDomainAssociationResource = new aws.apprunner.CustomDomainAssociation("customDomainAssociationResource", {
domainName: "string",
serviceArn: "string",
enableWwwSubdomain: false,
});
type: aws:apprunner:CustomDomainAssociation
properties:
domainName: string
enableWwwSubdomain: false
serviceArn: string
CustomDomainAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CustomDomainAssociation resource accepts the following input properties:
- Domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - Service
Arn string - ARN of the App Runner service.
- Enable
Www boolSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
- Domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - Service
Arn string - ARN of the App Runner service.
- Enable
Www boolSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
- domain
Name String - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - service
Arn String - ARN of the App Runner service.
- enable
Www BooleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
- domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - service
Arn string - ARN of the App Runner service.
- enable
Www booleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
- domain_
name str - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - service_
arn str - ARN of the App Runner service.
- enable_
www_ boolsubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
- domain
Name String - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - service
Arn String - ARN of the App Runner service.
- enable
Www BooleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
.
Outputs
All input properties are implicitly available as output properties. Additionally, the CustomDomainAssociation resource produces the following output properties:
- Certificate
Validation List<CustomRecords Domain Association Certificate Validation Record> - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- Dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- Certificate
Validation []CustomRecords Domain Association Certificate Validation Record - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- Dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation List<CustomRecords Domain Association Certificate Validation Record> - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target String - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation CustomRecords Domain Association Certificate Validation Record[] - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate_
validation_ Sequence[Customrecords Domain Association Certificate Validation Record] - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns_
target str - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation List<Property Map>Records - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target String - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
Look up Existing CustomDomainAssociation Resource
Get an existing CustomDomainAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CustomDomainAssociationState, opts?: CustomResourceOptions): CustomDomainAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
certificate_validation_records: Optional[Sequence[CustomDomainAssociationCertificateValidationRecordArgs]] = None,
dns_target: Optional[str] = None,
domain_name: Optional[str] = None,
enable_www_subdomain: Optional[bool] = None,
service_arn: Optional[str] = None,
status: Optional[str] = None) -> CustomDomainAssociation
func GetCustomDomainAssociation(ctx *Context, name string, id IDInput, state *CustomDomainAssociationState, opts ...ResourceOption) (*CustomDomainAssociation, error)
public static CustomDomainAssociation Get(string name, Input<string> id, CustomDomainAssociationState? state, CustomResourceOptions? opts = null)
public static CustomDomainAssociation get(String name, Output<String> id, CustomDomainAssociationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Certificate
Validation List<CustomRecords Domain Association Certificate Validation Record> - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- Dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- Domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - Enable
Www boolSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - Service
Arn string - ARN of the App Runner service.
- Status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- Certificate
Validation []CustomRecords Domain Association Certificate Validation Record Args - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- Dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- Domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - Enable
Www boolSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - Service
Arn string - ARN of the App Runner service.
- Status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation List<CustomRecords Domain Association Certificate Validation Record> - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target String - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- domain
Name String - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - enable
Www BooleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - service
Arn String - ARN of the App Runner service.
- status String
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation CustomRecords Domain Association Certificate Validation Record[] - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target string - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- domain
Name string - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - enable
Www booleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - service
Arn string - ARN of the App Runner service.
- status string
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate_
validation_ Sequence[Customrecords Domain Association Certificate Validation Record Args] - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns_
target str - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- domain_
name str - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - enable_
www_ boolsubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - service_
arn str - ARN of the App Runner service.
- status str
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
- certificate
Validation List<Property Map>Records - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
- dns
Target String - App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.
- domain
Name String - Custom domain endpoint to association. Specify a base domain e.g.,
example.com
or a subdomain e.g.,subdomain.example.com
. - enable
Www BooleanSubdomain - Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to
true
. - service
Arn String - ARN of the App Runner service.
- status String
- Current state of the certificate CNAME record validation. It should change to
SUCCESS
after App Runner completes validation with your DNS.
Supporting Types
CustomDomainAssociationCertificateValidationRecord, CustomDomainAssociationCertificateValidationRecordArgs
Import
Using pulumi import
, import App Runner Custom Domain Associations using the domain_name
and service_arn
separated by a comma (,
). For example:
$ pulumi import aws:apprunner/customDomainAssociation:CustomDomainAssociation example example.com,arn:aws:apprunner:us-east-1:123456789012:service/example-app/8fe1e10304f84fd2b0df550fe98a71fa
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.