Open james-tindal opened 4 months ago
@james-tindal thanks for bringing this to our attention. I've been able to repro this and confirm that this is only an issue with Pulumi (Terraform does not have this issue).
I also tried this with PlanResourceChange
which did not fix the issue.
Note: If you want to try and reproduce this you will need a real domain (domain_name
) and will have to manually add the CNAME records while the domain association is creating.
I was curious and looked a bit further into the field definition:
"certificate_settings": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"certificate_verification_dns_record": {
Type: schema.TypeString,
Computed: true,
},
names.AttrType: {
Type: schema.TypeString,
Required: true,
ValidateDiagFunc: enum.Validate[types.CertificateType](),
},
"custom_certificate_arn": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: verify.ValidARN,
},
},
},
},
Indeed appears to be an issue in pulumi-terraform-bridge.
Describe what happened
Pulumi always thinks my code has had a
certificateSettings
key removed from the DomainAssociation arguments. The problem is fixed by addingcertificateSettings: { type: 'AMPLIFY_MANAGED' }
to the DomainAssociation arguments.Sample program
The code:
```ts import * as pulumi from '@pulumi/pulumi' import * as aws from '@pulumi/aws' const config = new pulumi.Config() const githubRepo = 'james-tindal/game-of-life' const githubToken = config.requireSecret('github-access-token') const amplifyApp = new aws.amplify.App('amplify-game-of-life', { name: `game-of-life.jamestindal.co.uk`, repository: `https://github.com/${githubRepo}`, accessToken: githubToken, buildSpec: ` version: 1 frontend: artifacts: baseDirectory: src files: - '**/*' ` }) const mainBranch = new aws.amplify.Branch('amplify main branch', { appId: amplifyApp.id, branchName: 'main' }) const domainAssociation = new aws.amplify.DomainAssociation('domain association', { appId: amplifyApp.id, domainName: 'jamestindal.co.uk', subDomains: [{ branchName: mainBranch.branchName, prefix: 'game-of-life', }], waitForVerification: true }) ```Log output
pulumi preview
:pulumi preview --diff
:Affected Resource(s)
aws.amplify.DomainAssociation
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).