mirror of https://github.com/pulumi/pulumi.git
29 lines
655 B
Go
29 lines
655 B
Go
package main
|
|
|
|
import (
|
|
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
|
|
"github.com/pulumi/pulumi-aws/sdk/v5/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
|
|
})
|
|
}
|