rich-motorcycle-71684
03/27/2023, 12:54 AMPulumi.develop.yaml
file
config:
aws:profile: 028111111111_AWSAdministratorAccess
aws:region: ap-southeast-2
myprojectname:aws_account_id: "028111111111"
myprojectname:dns_domain: "redacted"
myprojectname:aws_route53_zoneid: "redacted"
When I attempt to use this value aws_account_id
in the code, it strips the zero. The stripping doesn't happen to the aws:profile
. Perhaps because it contains some alpha characters too, or perhaps because the aws provider handles the variable differently.
This is where I tried to use it (in an IAM policy)
# Allow to send emails with SES.
- Action:
- ses:SendEmail
Effect: Allow
Resource: "*" # "arn:aws:ses:${aws:region}:${aws_account_id}:identity/${ses_DomainIdentity.domain}" # can't use this due to bug with yaml stripping leading 0 from aws_account_id
salmon-account-74572
03/27/2023, 2:22 PMconfig
block of your Pulumi.yaml
file? If so, you can specify a type
property there (set it to “string”), and that may help resolve the issue.rich-motorcycle-71684
03/28/2023, 4:11 AMconfig
section in Pulumi.yaml
. I'll look into thataws_account_id
is different for each stack hence its original location in the stack files i.e. Pulumi.develop.yaml
, Pulumi.staging.yaml
etc.
I tried to implement your suggestion by adding a couple of lines under config:
at the top of Pulumi.yaml
like so:
config:
...
aws_account_id:
type: string
Then I printed the output like so:
outputs:
# Debug printouts
accIDString: "${aws_account_id}"
And it's still getting converted.
Outputs:
+ accIDString : 2.809102044e+10
I also tried a slightly different way, but this just printed the variable name
config:
awsAccountID:
type: string
default: ${aws_account_id}
...
outputs:
# Debug printouts
accIDString: "${awsAccountID}"
~~~~~~~~
Outputs:
+ accIDString : "${aws_account_id}"
billowy-army-68599
03/28/2023, 1:35 PMrich-motorcycle-71684
05/02/2023, 1:08 AM