This Pulumi template bootstraps a minimal Go project that provisions an AWS S3 bucket. It uses the Pulumi AWS provider to create the bucket and exports its name as an output.
Use this template when you want to:
- Get started quickly with Pulumi and Go for AWS workloads
- Provision a simple S3 bucket with minimal configuration
- Learn how Pulumi programs are structured in Go
- AWS Provider (
github.com/pulumi/pulumi-aws/sdk/v6) - Resource Created:
aws:s3/bucket:Bucketvias3.NewBucketV2
bucketName: The unique name/ID of the created S3 bucket
- Go 1.20 or later
- An AWS account with credentials configured in your environment (for example, via the AWS CLI)
- Pulumi CLI installed and authenticated
-
Create a new stack/project from this template:
pulumi new aws-go
-
Follow the interactive prompts to set:
- Project name (used in
Pulumi.yaml) - Project description
- AWS region (defaults to
us-east-1)
- Project name (used in
-
Preview your changes:
pulumi preview
-
Deploy your stack:
pulumi up
-
Verify the output:
pulumi stack output bucketName
.
├── Pulumi.yaml Pulumi project settings and metadata
├── go.mod Go module definition (updated on `pulumi new`)
└── main.go Pulumi program that creates the S3 bucket
The following configuration keys are available:
aws:region(string): The AWS region where resources will be created. Default:us-east-1.
You can view or update configuration values with:
pulumi config get aws:region
pulumi config set aws:region us-west-2- Customize the bucket by passing options to
s3.NewBucketV2, such as versioning, encryption, tags, etc. - Add additional AWS resources (e.g., IAM roles, DynamoDB tables) by importing and using other Pulumi AWS SDK packages.
- Explore Pulumi’s Go SDK patterns, such as component resources and functions.
- Integrate infrastructure as code into your CI/CD pipelines.
If you run into issues or have questions:
- Check the Pulumi documentation: https://www.pulumi.com/docs/
- Browse AWS provider reference: https://www.pulumi.com/registry/packages/aws/api-docs/
- Ask in the Pulumi Community Slack: https://slack.pulumi.com/
- Open an issue on the template’s repository (if available)
Enjoy building cloud infrastructure with Go and Pulumi!