Hello Folks, I'm working thru an example of creat...
# golang
b
Hello Folks, I'm working thru an example of creating an ECR repository in pulumi and this snippet is failing on the
EncryptionConfigurations
method and I searched all the documentation online for a solution and couldn't find one.
Copy code
pulumi.Run(func(ctx *pulumi.Context) error {
		repo, err := ecr.NewRepository(ctx, "rundeck", &ecr.RepositoryArgs{
			Name: pulumi.String("rundeck"),
			ImageScanningConfiguration: &ecr.RepositoryImageScanningConfigurationArgs{
				ScanOnPush: pulumi.Bool(true),
			},
			EncryptionConfigurations: &ecr.RepositoryEncryptionConfigurationArgs{
			 	EncryptionType: pulumi.String("AES256"),
			},
			ImageTagMutability: pulumi.String("IMMUTABLE"),
		})
This is the error message that I'm experiencing.
Copy code
/home/fearfactor3/repos/rundeck.iac/main.go:19:30 cannot use &ecr.RepositoryEncryptionConfigurationArgs{…} (value of type *ecr.RepositoryEncryptionConfigurationArgs) as ecr.
RepositoryEncryptionConfigurationArrayInput value in struct literal: *ecr.
RepositoryEncryptionConfigurationArgs does not implement ecr.
RepositoryEncryptionConfigurationArrayInput (missing method ToRepositoryEncryptionConfigurationArrayOutput) (compile)
Can anyone provide assistance here?
s
Without running this code or having built and encryption repo, the error reads that the config args instance you passed doesn't implement the ecr interface, so you need to pass an ecr by the looks. And perhaps you build your ecr with the config args instance you have at hand.