sparse-intern-71089
05/26/2020, 10:02 PMgentle-diamond-70147
05/26/2020, 10:48 PMimportant-appointment-55126
05/27/2020, 1:20 AMiam.NewPolicy(name…
defined; it logged as successfully created, etc - i later had an update to change the Name
property of it, but the update failed..
aws:iam:Policy (cyberdyneDataWriter):
error: deleting urn:pulumi:dev::data-archive::aws:iam/policy:Policy::cyberdyneDataWriter: Error listing versions for IAM policy arn:aws:iam::123404803574:policy/cyberdyneDataWriter: NoSuchEntity: Policy arn:aws:iam::123404803574:policy/cyberdyneDataWriter does not exist or is not attachable
important-appointment-55126
05/27/2020, 1:20 AMimportant-appointment-55126
05/27/2020, 2:02 AMpackage main
import (
"log"
"<http://github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam|github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam>"
"<http://github.com/pulumi/pulumi/sdk/v2/go/pulumi|github.com/pulumi/pulumi/sdk/v2/go/pulumi>"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
policy, err := iam.NewPolicy(ctx, "pulumiTestPolicy", &iam.PolicyArgs{
Name: pulumi.String("pulumiTestPolicy"),
Policy: pulumi.String(`{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListAll",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "*"
}
]
}`),
})
if err != nil {
log.Fatal(err)
}
// Export the name of the bucket
ctx.Export("policyARN", policy.Arn)
return nil
})
}
important-appointment-55126
05/27/2020, 2:03 AMName
and run pulumi up
, all is good and the old policy is deleted and a new one with the new name is created as expectedimportant-appointment-55126
05/27/2020, 2:04 AMName
and introduce an error at the same time such as a typo in the policy itself, it will delete the old policy and fail to create the new one - but Pulumi still tracks that the old policy exists and so even fixing the policy JSON fails as it can no-longer delete the policy it believes still existsimportant-appointment-55126
05/27/2020, 4:12 PMgentle-diamond-70147
05/27/2020, 4:23 PMimportant-appointment-55126
05/27/2020, 5:40 PM