pulumi-aws icon indicating copy to clipboard operation
pulumi-aws copied to clipboard

Setting default Encryption on a s3 Bucket gives an error

Open gertjana opened this issue 2 years ago • 2 comments

Hi. pulumi devs,

developing on linux (manjaro 5.15.48-1)

go 1.17
require (
	github.com/pulumi/pulumi-aws/sdk/v5 v5.9.0
	github.com/pulumi/pulumi/sdk/v3 v3.34.1
)

I'm try-ing to setup default encryption on a s3 bucket I used the following code from the documentation here

if _, err = s3.NewBucketServerSideEncryptionConfigurationV2(ctx, "bucketEncryption", &s3.BucketServerSideEncryptionConfigurationV2Args{
	Bucket: bucket.Bucket,
	Rules: s3.BucketServerSideEncryptionConfigurationV2RuleArray{
		&s3.BucketServerSideEncryptionConfigurationV2RuleArgs{
			ApplyServerSideEncryptionByDefault: &s3.BucketServerSideEncryptionConfigurationV2RuleApplyServerSideEncryptionByDefaultArgs{
				SseAlgorithm: pulumi.String("aws:kms"),
			},
		},
	},
}); err != nil {
	return err
}

but it gives me the following error:

  aws:s3:Bucket (test-bucket):
    error: aws:s3/bucket:Bucket resource 'test-bucket' has a problem: Missing required argument: The argument "server_side_encryption_configuration.0.rule" is required, but no definition was found.. Examine values at 'Bucket.ServerSideEncryptionConfiguration.Rule'.
 

I tried browsing the source code, but as it is all generated, I haven't been able to pinpoint what or where it is wrong. any pointers on how to proceed? Is the documentation wrong. or is there a bug somewhere?

gertjana avatar Jun 21 '22 13:06 gertjana

sorry, PEBCAK

gertjana avatar Jun 21 '22 14:06 gertjana

It appears to be that you may be missing a required property, though it's hard to map the error message back to Go code. Do you have a full working sample? Also - did you fix the issue by yourself or need some further assistance?

t0yv0 avatar Jun 21 '22 18:06 t0yv0