pulumi/tests/testdata/codegen/aws-resource-options-4.26-pp/go/aws-resource-options-4.26.go

29 lines
655 B
Go

package main
import (
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
provider, err := aws.NewProvider(ctx, "provider", &aws.ProviderArgs{
Region: pulumi.String("us-west-2"),
})
if err != nil {
return err
}
_, err = s3.NewBucket(ctx, "bucket1", nil, pulumi.Provider(provider), pulumi.DependsOn([]pulumi.Resource{
provider,
}), pulumi.Protect(true), pulumi.IgnoreChanges([]string{
"bucket",
"lifecycleRules[0]",
}))
if err != nil {
return err
}
return nil
})
}