driftctl/pkg/resource/aws/aws_s3_bucket.go

21 lines
657 B
Go
Raw Normal View History

package aws
2021-04-29 14:36:05 +00:00
import (
"github.com/cloudskiff/driftctl/pkg/resource"
)
2021-03-25 11:13:52 +00:00
const AwsS3BucketResourceType = "aws_s3_bucket"
2021-04-29 14:36:05 +00:00
func initAwsS3BucketMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.UpdateSchema(AwsS3BucketResourceType, map[string]func(attributeSchema *resource.AttributeSchema){
"policy": func(attributeSchema *resource.AttributeSchema) {
attributeSchema.JsonString = true
},
})
2021-08-09 14:03:04 +00:00
resourceSchemaRepository.SetNormalizeFunc(AwsS3BucketResourceType, func(res *resource.Resource) {
val := res.Attrs
2021-04-29 14:36:05 +00:00
val.SafeDelete([]string{"force_destroy"})
val.SafeDelete([]string{"bucket_prefix"})
2021-04-29 14:36:05 +00:00
})
}