Try AWS Native preview for resources not in the classic version.
aws.amplify.DomainAssociation
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides an Amplify Domain Association resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleApp = new Aws.Amplify.App("exampleApp", new()
{
CustomRules = new[]
{
new Aws.Amplify.Inputs.AppCustomRuleArgs
{
Source = "https://example.com",
Status = "302",
Target = "https://www.example.com",
},
},
});
var master = new Aws.Amplify.Branch("master", new()
{
AppId = exampleApp.Id,
BranchName = "master",
});
var exampleDomainAssociation = new Aws.Amplify.DomainAssociation("exampleDomainAssociation", new()
{
AppId = exampleApp.Id,
DomainName = "example.com",
SubDomains = new[]
{
new Aws.Amplify.Inputs.DomainAssociationSubDomainArgs
{
BranchName = master.BranchName,
Prefix = "",
},
new Aws.Amplify.Inputs.DomainAssociationSubDomainArgs
{
BranchName = master.BranchName,
Prefix = "www",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/amplify"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleApp, err := amplify.NewApp(ctx, "exampleApp", &lify.AppArgs{
CustomRules: amplify.AppCustomRuleArray{
&lify.AppCustomRuleArgs{
Source: pulumi.String("https://example.com"),
Status: pulumi.String("302"),
Target: pulumi.String("https://www.example.com"),
},
},
})
if err != nil {
return err
}
master, err := amplify.NewBranch(ctx, "master", &lify.BranchArgs{
AppId: exampleApp.ID(),
BranchName: pulumi.String("master"),
})
if err != nil {
return err
}
_, err = amplify.NewDomainAssociation(ctx, "exampleDomainAssociation", &lify.DomainAssociationArgs{
AppId: exampleApp.ID(),
DomainName: pulumi.String("example.com"),
SubDomains: amplify.DomainAssociationSubDomainArray{
&lify.DomainAssociationSubDomainArgs{
BranchName: master.BranchName,
Prefix: pulumi.String(""),
},
&lify.DomainAssociationSubDomainArgs{
BranchName: master.BranchName,
Prefix: pulumi.String("www"),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.amplify.App;
import com.pulumi.aws.amplify.AppArgs;
import com.pulumi.aws.amplify.inputs.AppCustomRuleArgs;
import com.pulumi.aws.amplify.Branch;
import com.pulumi.aws.amplify.BranchArgs;
import com.pulumi.aws.amplify.DomainAssociation;
import com.pulumi.aws.amplify.DomainAssociationArgs;
import com.pulumi.aws.amplify.inputs.DomainAssociationSubDomainArgs;
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 exampleApp = new App("exampleApp", AppArgs.builder()
.customRules(AppCustomRuleArgs.builder()
.source("https://example.com")
.status("302")
.target("https://www.example.com")
.build())
.build());
var master = new Branch("master", BranchArgs.builder()
.appId(exampleApp.id())
.branchName("master")
.build());
var exampleDomainAssociation = new DomainAssociation("exampleDomainAssociation", DomainAssociationArgs.builder()
.appId(exampleApp.id())
.domainName("example.com")
.subDomains(
DomainAssociationSubDomainArgs.builder()
.branchName(master.branchName())
.prefix("")
.build(),
DomainAssociationSubDomainArgs.builder()
.branchName(master.branchName())
.prefix("www")
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
example_app = aws.amplify.App("exampleApp", custom_rules=[aws.amplify.AppCustomRuleArgs(
source="https://example.com",
status="302",
target="https://www.example.com",
)])
master = aws.amplify.Branch("master",
app_id=example_app.id,
branch_name="master")
example_domain_association = aws.amplify.DomainAssociation("exampleDomainAssociation",
app_id=example_app.id,
domain_name="example.com",
sub_domains=[
aws.amplify.DomainAssociationSubDomainArgs(
branch_name=master.branch_name,
prefix="",
),
aws.amplify.DomainAssociationSubDomainArgs(
branch_name=master.branch_name,
prefix="www",
),
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleApp = new aws.amplify.App("exampleApp", {customRules: [{
source: "https://example.com",
status: "302",
target: "https://www.example.com",
}]});
const master = new aws.amplify.Branch("master", {
appId: exampleApp.id,
branchName: "master",
});
const exampleDomainAssociation = new aws.amplify.DomainAssociation("exampleDomainAssociation", {
appId: exampleApp.id,
domainName: "example.com",
subDomains: [
{
branchName: master.branchName,
prefix: "",
},
{
branchName: master.branchName,
prefix: "www",
},
],
});
resources:
exampleApp:
type: aws:amplify:App
properties:
# Setup redirect from https://example.com to https://www.example.com
customRules:
- source: https://example.com
status: '302'
target: https://www.example.com
master:
type: aws:amplify:Branch
properties:
appId: ${exampleApp.id}
branchName: master
exampleDomainAssociation:
type: aws:amplify:DomainAssociation
properties:
appId: ${exampleApp.id}
domainName: example.com
# https://example.com
subDomains:
- branchName: ${master.branchName}
prefix:
- branchName: ${master.branchName}
prefix: www
Create DomainAssociation Resource
new DomainAssociation(name: string, args: DomainAssociationArgs, opts?: CustomResourceOptions);
@overload
def DomainAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
app_id: Optional[str] = None,
domain_name: Optional[str] = None,
enable_auto_sub_domain: Optional[bool] = None,
sub_domains: Optional[Sequence[DomainAssociationSubDomainArgs]] = None,
wait_for_verification: Optional[bool] = None)
@overload
def DomainAssociation(resource_name: str,
args: DomainAssociationArgs,
opts: Optional[ResourceOptions] = None)
func NewDomainAssociation(ctx *Context, name string, args DomainAssociationArgs, opts ...ResourceOption) (*DomainAssociation, error)
public DomainAssociation(string name, DomainAssociationArgs args, CustomResourceOptions? opts = null)
public DomainAssociation(String name, DomainAssociationArgs args)
public DomainAssociation(String name, DomainAssociationArgs args, CustomResourceOptions options)
type: aws:amplify:DomainAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainAssociationArgs
- 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 DomainAssociationArgs
- 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 DomainAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DomainAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DomainAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The DomainAssociation resource accepts the following input properties:
- App
Id string Unique ID for an Amplify app.
- Domain
Name string Domain name for the domain association.
- Sub
Domains List<DomainAssociation Sub Domain> Setting for the subdomain. Documented below.
- Enable
Auto boolSub Domain Enables the automated creation of subdomains for branches.
- Wait
For boolVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- App
Id string Unique ID for an Amplify app.
- Domain
Name string Domain name for the domain association.
- Sub
Domains []DomainAssociation Sub Domain Args Setting for the subdomain. Documented below.
- Enable
Auto boolSub Domain Enables the automated creation of subdomains for branches.
- Wait
For boolVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id String Unique ID for an Amplify app.
- domain
Name String Domain name for the domain association.
- sub
Domains List<DomainAssociation Sub Domain> Setting for the subdomain. Documented below.
- enable
Auto BooleanSub Domain Enables the automated creation of subdomains for branches.
- wait
For BooleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id string Unique ID for an Amplify app.
- domain
Name string Domain name for the domain association.
- sub
Domains DomainAssociation Sub Domain[] Setting for the subdomain. Documented below.
- enable
Auto booleanSub Domain Enables the automated creation of subdomains for branches.
- wait
For booleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app_
id str Unique ID for an Amplify app.
- domain_
name str Domain name for the domain association.
- sub_
domains Sequence[DomainAssociation Sub Domain Args] Setting for the subdomain. Documented below.
- enable_
auto_ boolsub_ domain Enables the automated creation of subdomains for branches.
- wait_
for_ boolverification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id String Unique ID for an Amplify app.
- domain
Name String Domain name for the domain association.
- sub
Domains List<Property Map> Setting for the subdomain. Documented below.
- enable
Auto BooleanSub Domain Enables the automated creation of subdomains for branches.
- wait
For BooleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
Outputs
All input properties are implicitly available as output properties. Additionally, the DomainAssociation resource produces the following output properties:
- Arn string
ARN for the domain association.
- Certificate
Verification stringDns Record The DNS record for certificate verification.
- Id string
The provider-assigned unique ID for this managed resource.
- Arn string
ARN for the domain association.
- Certificate
Verification stringDns Record The DNS record for certificate verification.
- Id string
The provider-assigned unique ID for this managed resource.
- arn String
ARN for the domain association.
- certificate
Verification StringDns Record The DNS record for certificate verification.
- id String
The provider-assigned unique ID for this managed resource.
- arn string
ARN for the domain association.
- certificate
Verification stringDns Record The DNS record for certificate verification.
- id string
The provider-assigned unique ID for this managed resource.
- arn str
ARN for the domain association.
- certificate_
verification_ strdns_ record The DNS record for certificate verification.
- id str
The provider-assigned unique ID for this managed resource.
- arn String
ARN for the domain association.
- certificate
Verification StringDns Record The DNS record for certificate verification.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing DomainAssociation Resource
Get an existing DomainAssociation 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?: DomainAssociationState, opts?: CustomResourceOptions): DomainAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
app_id: Optional[str] = None,
arn: Optional[str] = None,
certificate_verification_dns_record: Optional[str] = None,
domain_name: Optional[str] = None,
enable_auto_sub_domain: Optional[bool] = None,
sub_domains: Optional[Sequence[DomainAssociationSubDomainArgs]] = None,
wait_for_verification: Optional[bool] = None) -> DomainAssociation
func GetDomainAssociation(ctx *Context, name string, id IDInput, state *DomainAssociationState, opts ...ResourceOption) (*DomainAssociation, error)
public static DomainAssociation Get(string name, Input<string> id, DomainAssociationState? state, CustomResourceOptions? opts = null)
public static DomainAssociation get(String name, Output<String> id, DomainAssociationState 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.
- App
Id string Unique ID for an Amplify app.
- Arn string
ARN for the domain association.
- Certificate
Verification stringDns Record The DNS record for certificate verification.
- Domain
Name string Domain name for the domain association.
- Enable
Auto boolSub Domain Enables the automated creation of subdomains for branches.
- Sub
Domains List<DomainAssociation Sub Domain> Setting for the subdomain. Documented below.
- Wait
For boolVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- App
Id string Unique ID for an Amplify app.
- Arn string
ARN for the domain association.
- Certificate
Verification stringDns Record The DNS record for certificate verification.
- Domain
Name string Domain name for the domain association.
- Enable
Auto boolSub Domain Enables the automated creation of subdomains for branches.
- Sub
Domains []DomainAssociation Sub Domain Args Setting for the subdomain. Documented below.
- Wait
For boolVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id String Unique ID for an Amplify app.
- arn String
ARN for the domain association.
- certificate
Verification StringDns Record The DNS record for certificate verification.
- domain
Name String Domain name for the domain association.
- enable
Auto BooleanSub Domain Enables the automated creation of subdomains for branches.
- sub
Domains List<DomainAssociation Sub Domain> Setting for the subdomain. Documented below.
- wait
For BooleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id string Unique ID for an Amplify app.
- arn string
ARN for the domain association.
- certificate
Verification stringDns Record The DNS record for certificate verification.
- domain
Name string Domain name for the domain association.
- enable
Auto booleanSub Domain Enables the automated creation of subdomains for branches.
- sub
Domains DomainAssociation Sub Domain[] Setting for the subdomain. Documented below.
- wait
For booleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app_
id str Unique ID for an Amplify app.
- arn str
ARN for the domain association.
- certificate_
verification_ strdns_ record The DNS record for certificate verification.
- domain_
name str Domain name for the domain association.
- enable_
auto_ boolsub_ domain Enables the automated creation of subdomains for branches.
- sub_
domains Sequence[DomainAssociation Sub Domain Args] Setting for the subdomain. Documented below.
- wait_
for_ boolverification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
- app
Id String Unique ID for an Amplify app.
- arn String
ARN for the domain association.
- certificate
Verification StringDns Record The DNS record for certificate verification.
- domain
Name String Domain name for the domain association.
- enable
Auto BooleanSub Domain Enables the automated creation of subdomains for branches.
- sub
Domains List<Property Map> Setting for the subdomain. Documented below.
- wait
For BooleanVerification If enabled, the resource will wait for the domain association status to change to
PENDING_DEPLOYMENT
orAVAILABLE
. Setting this tofalse
will skip the process. Default:true
.
Supporting Types
DomainAssociationSubDomain, DomainAssociationSubDomainArgs
- Branch
Name string Branch name setting for the subdomain.
- Prefix string
Prefix setting for the subdomain.
- Dns
Record string DNS record for the subdomain.
- Verified bool
Verified status of the subdomain.
- Branch
Name string Branch name setting for the subdomain.
- Prefix string
Prefix setting for the subdomain.
- Dns
Record string DNS record for the subdomain.
- Verified bool
Verified status of the subdomain.
- branch
Name String Branch name setting for the subdomain.
- prefix String
Prefix setting for the subdomain.
- dns
Record String DNS record for the subdomain.
- verified Boolean
Verified status of the subdomain.
- branch
Name string Branch name setting for the subdomain.
- prefix string
Prefix setting for the subdomain.
- dns
Record string DNS record for the subdomain.
- verified boolean
Verified status of the subdomain.
- branch_
name str Branch name setting for the subdomain.
- prefix str
Prefix setting for the subdomain.
- dns_
record str DNS record for the subdomain.
- verified bool
Verified status of the subdomain.
- branch
Name String Branch name setting for the subdomain.
- prefix String
Prefix setting for the subdomain.
- dns
Record String DNS record for the subdomain.
- verified Boolean
Verified status of the subdomain.
Import
Using pulumi import
, import Amplify domain association using app_id
and domain_name
. For example:
$ pulumi import aws:amplify/domainAssociation:DomainAssociation app d2ypk4k47z8u6/example.com
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.