This repository was archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
Add DeletionPolicy as an option for S3 Custom Resources #126
Copy link
Copy link
Open
Labels
kind/bugSomething isn't workingSomething isn't workingoperator/s3bucketS3 Bucket operator packageS3 Bucket operator package
Description
I'm not sure if this is an issue with the service operator or with something in cloudformation, but here's what I'm seeing.
- Create an S3 bucket with logging disabled, versioning enabled, and accessControl Private. All here works fine.
- Delete the S3 resource from k8s (no files added to the bucket, no actions performed at all other than looking at it to verify proper creation parameters) and the CF stack skips the delete with no reason provided. After the SKIP message, the errors are emitted from the operator (log below) regarding missing information.
- The S3 resource is removed from k8s, but the ConfigMap and Service are still present and the bucket is still in place.
I'm happy to provide any information which might be of interest in solving this problem. I'm still looking into details myself but want to see if others are experiencing the same problem.
Here is a partial log of the output with some values altered to protect some information:
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:27Z" level=info msg="deleted s3bucket 'rocklin-aws-so-test'" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:37Z" level=debug msg="&{Type:Notification TopicArn:arn:aws:sns:us-east-2:123456789012:dt-ue2-s3bucket Message:StackId='arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e'\nTimestamp='2018-10-19T11:42:27.639Z'\nEventId='0de67df0-d394-11e8-9ddf-0aa0cd9d9f9c'\nLogicalResourceId='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\nNamespace='123456789012'\nPhysicalResourceId='arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e'\nPrincipalId='AROAISVCX6PVI5CBBLZ3K:kiam-kiam'\nResourceProperties='null'\nResourceStatus='DELETE_IN_PROGRESS'\nResourceStatusReason='User Initiated'\nResourceType='AWS::CloudFormation::Stack'\nStackName='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\nClientRequestToken='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\n ParsedMessage:map[Timestamp:2018-10-19T11:42:27.639Z EventId:0de67df0-d394-11e8-9ddf-0aa0cd9d9f9c LogicalResourceId:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops PhysicalResourceId:arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e PrincipalId:AROAISVCX6PVI5CBBLZ3K:kiam-kiam ResourceStatus:DELETE_IN_PROGRESS ClientRequestToken:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops StackId:arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e Namespace:123456789012 ResourceProperties:null ResourceStatusReason:User Initiated ResourceType:AWS::CloudFormation::Stack StackName:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops] Namespace: ResourceName: ResourceProperties:{Tags:[]} Updatable:false}" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:37Z" level=debug msg="stackID arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e updated status to DELETE_IN_PROGRESS" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=debug msg="&{Type:Notification TopicArn:arn:aws:sns:us-east-2:123456789012:dt-ue2-s3bucket Message:StackId='arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e'\nTimestamp='2018-10-19T11:42:29.259Z'\nEventId='S3bucket-DELETE_SKIPPED-2018-10-19T11:42:29.259Z'\nLogicalResourceId='S3bucket'\nNamespace='123456789012'\nPhysicalResourceId='rocklin-aws-so-test'\nResourceProperties='{\"BucketName\":\"rocklin-aws-so-test\",\"LifecycleConfiguration\":{\"Rules\":[{\"Status\":\"Enabled\",\"Transitions\":[{\"StorageClass\":\"Glacier\",\"TransitionInDays\":\"0\"}],\"ExpirationInDays\":\"365\",\"Id\":\"GlacierRule\",\"Prefix\":\"Archive\"}]},\"VersioningConfiguration\":{\"Status\":\"Enabled\"},\"AccessControl\":\"Private\",\"Tags\":[{\"Value\":\"projectName-ops\",\"Key\":\"Namespace\"},{\"Value\":\"36749881\",\"Key\":\"ResourceVersion\"},{\"Value\":\"rocklin-aws-so-test\",\"Key\":\"ResourceName\"},{\"Value\":\"dt-ue2\",\"Key\":\"ClusterName\"},{\"Value\":\"operator.aws\",\"Key\":\"Heritage\"}]}'\nResourceStatus='DELETE_SKIPPED'\nResourceStatusReason=''\nResourceType='AWS::S3::Bucket'\nStackName='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\nClientRequestToken='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\n ParsedMessage:map[ResourceStatus:DELETE_SKIPPED ResourceType:AWS::S3::Bucket Timestamp:2018-10-19T11:42:29.259Z EventId:S3bucket-DELETE_SKIPPED-2018-10-19T11:42:29.259Z Namespace:123456789012 ResourceProperties:{\"BucketName\":\"rocklin-aws-so-test\",\"LifecycleConfiguration\":{\"Rules\":[{\"Status\":\"Enabled\",\"Transitions\":[{\"StorageClass\":\"Glacier\",\"TransitionInDays\":\"0\"}],\"ExpirationInDays\":\"365\",\"Id\":\"GlacierRule\",\"Prefix\":\"Archive\"}]},\"VersioningConfiguration\":{\"Status\":\"Enabled\"},\"AccessControl\":\"Private\",\"Tags\":[{\"Value\":\"projectName-ops\",\"Key\":\"Namespace\"},{\"Value\":\"36749881\",\"Key\":\"ResourceVersion\"},{\"Value\":\"rocklin-aws-so-test\",\"Key\":\"ResourceName\"},{\"Value\":\"dt-ue2\",\"Key\":\"ClusterName\"},{\"Value\":\"operator.aws\",\"Key\":\"Heritage\"}]} StackName:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops ClientRequestToken:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops StackId:arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e LogicalResourceId:S3bucket PhysicalResourceId:rocklin-aws-so-test ResourceStatusReason:] Namespace:projectName-ops ResourceName:rocklin-aws-so-test ResourceProperties:{Tags:[{Key:Namespace Value:projectName-ops} {Key:ResourceVersion Value:36749881} {Key:ResourceName Value:rocklin-aws-so-test} {Key:ClusterName Value:dt-ue2} {Key:Heritage Value:operator.aws}]} Updatable:true}" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=error msg="error getting s3buckets" error="s3buckets.service-operator.aws \"rocklin-aws-so-test\" not found" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=error msg="error processing message" error="s3buckets.service-operator.aws \"rocklin-aws-so-test\" not found" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=debug msg="stackID arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e updated status to DELETE_SKIPPED" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=debug msg="&{Type:Notification TopicArn:arn:aws:sns:us-east-2:123456789012:dt-ue2-s3bucket Message:StackId='arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e'\nTimestamp='2018-10-19T11:42:29.822Z'\nEventId='0f356c20-d394-11e8-8b3f-023ea1ad1aec'\nLogicalResourceId='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\nNamespace='123456789012'\nPhysicalResourceId='arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e'\nPrincipalId='AROAISVCX6PVI5CBBLZ3K:kiam-kiam'\nResourceProperties='null'\nResourceStatus='DELETE_COMPLETE'\nResourceStatusReason=''\nResourceType='AWS::CloudFormation::Stack'\nStackName='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\nClientRequestToken='dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops'\n ParsedMessage:map[ResourceProperties:null ResourceStatusReason: ClientRequestToken:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops Namespace:123456789012 PrincipalId:AROAISVCX6PVI5CBBLZ3K:kiam-kiam EventId:0f356c20-d394-11e8-8b3f-023ea1ad1aec LogicalResourceId:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops PhysicalResourceId:arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e ResourceStatus:DELETE_COMPLETE ResourceType:AWS::CloudFormation::Stack StackName:dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops StackId:arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e Timestamp:2018-10-19T11:42:29.822Z] Namespace: ResourceName: ResourceProperties:{Tags:[]} Updatable:false}" hostname=aws-service-operator-587fff54f4-cx474
aws-service-operator-587fff54f4-cx474 aws-service-operator time="2018-10-19T11:42:39Z" level=debug msg="stackID arn:aws:cloudformation:us-east-2:123456789012:stack/dt-ue2-s3bucket-rocklin-aws-so-test-projectName-ops/e393d610-d393-11e8-b80e-0264de9b3f5e updated status to DELETE_COMPLETE" hostname=aws-service-operator-587fff54f4-cx474
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't workingoperator/s3bucketS3 Bucket operator packageS3 Bucket operator package