A Pulumi provider SDK for creating and managing Amazon Web Services (AWS) cloud resources in Go, providing strongly-typed resource classes and data sources for all major AWS services.
The Pulumi AWS Provider (github.com/pulumi/pulumi-aws/sdk/v7) is a Go SDK for creating and managing Amazon Web Services (AWS) cloud resources using Pulumi's infrastructure-as-code framework. It provides strongly-typed resource classes and data sources for all major AWS services.
github.com/pulumi/pulumi-aws/sdk/v7go get github.com/pulumi/pulumi-aws/sdk/v7import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
bucket, err := s3.NewBucketV2(ctx, "my-bucket", &s3.BucketV2Args{
Bucket: pulumi.String("my-unique-bucket-name"),
})
if err != nil {
return err
}
ctx.Export("bucketName", bucket.Bucket)
return nil
})
}// Create a resource
func New<ResourceName>(ctx *pulumi.Context, name string, args *<ResourceName>Args, opts ...pulumi.ResourceOption) (*<ResourceName>, error)
// Import existing resource
func Get<ResourceName>(ctx *pulumi.Context, name string, id pulumi.IDInput, state *<ResourceName>State, opts ...pulumi.ResourceOption) (*<ResourceName>, error)// Synchronous lookup
func Lookup<Name>(ctx *pulumi.Context, args *Lookup<Name>Args, opts ...pulumi.InvokeOption) (*Lookup<Name>Result, error)
// Output variant (for dependencies)
func Lookup<Name>Output(ctx *pulumi.Context, args Lookup<Name>OutputArgs, opts ...pulumi.InvokeOption) Lookup<Name>ResultOutput// Input/Output types
pulumi.String("value") // pulumi.StringInput / pulumi.StringOutput
pulumi.StringPtr("value") // pulumi.StringPtrInput / pulumi.StringPtrOutput
pulumi.StringArray{...} // pulumi.StringArrayInput / pulumi.StringArrayOutput
pulumi.StringMap{...} // pulumi.StringMapInput / pulumi.StringMapOutput
// Special types
pulumi.ID("id") // Resource identifiers
pulumi.NewFileArchive("path") // Lambda deployments
pulumi.NewFileAsset("path") // File uploadspulumi.DependsOn([]pulumi.Resource{other}) // Explicit dependency
pulumi.Parent(parent) // Parent-child relationship
pulumi.Provider(customProvider) // Custom provider
pulumi.Import(pulumi.ID("existing-id")) // Import existing resource
pulumi.IgnoreChanges([]string{"tags"}) // Ignore field changes
pulumi.Protect(true) // Prevent deletion200+ AWS services available → Complete Service List
| Service | Resource | Constructor |
|---|---|---|
| S3 | Bucket | s3.NewBucketV2(ctx, name, args, opts) |
| Lambda | Function | lambda.NewFunction(ctx, name, args, opts) |
| EC2 | Instance | ec2.NewInstance(ctx, name, args, opts) |
| EC2 | VPC | ec2.NewVpc(ctx, name, args, opts) |
| RDS | Database | rds.NewInstance(ctx, name, args, opts) |
| DynamoDB | Table | dynamodb.NewTable(ctx, name, args, opts) |
| IAM | Role | iam.NewRole(ctx, name, args, opts) |
| ECS | Cluster | ecs.NewCluster(ctx, name, args, opts) |
| EKS | Cluster | eks.NewCluster(ctx, name, args, opts) |
| Purpose | Function |
|---|---|
| Current account ID | aws.GetCallerIdentity(ctx, args, opts) |
| Current region | aws.GetRegion(ctx, args, opts) |
| Available AZs | aws.GetAvailabilityZones(ctx, args, opts) |
| Latest AMI | ec2.LookupAmi(ctx, args, opts) |
| Existing VPC | ec2.LookupVpc(ctx, args, opts) |
// Default provider (uses environment variables)
bucket, err := s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{...})
// Custom provider
provider, err := aws.NewProvider(ctx, "custom", &aws.ProviderArgs{
Region: pulumi.StringPtr("us-east-1"),
Profile: pulumi.StringPtr("production"),
})
bucket, err := s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{...},
pulumi.Provider(provider))→ Provider Configuration Reference
resource, err := service.NewResource(ctx, "name", &service.ResourceArgs{})
if err != nil {
return err
}// Implicit (automatic)
bucket, err := s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{})
policy, err := s3.NewBucketPolicy(ctx, "policy", &s3.BucketPolicyArgs{
Bucket: bucket.ID(), // Implicit dependency
})
// Explicit (manual)
resource, err := service.NewResource(ctx, "resource", &service.ResourceArgs{},
pulumi.DependsOn([]pulumi.Resource{other}))transformedOutput := resource.Field.ApplyT(func(value string) (string, error) {
return fmt.Sprintf("transformed-%s", value), nil
}).(pulumi.StringOutput)Over 200 AWS service packages are available under github.com/pulumi/pulumi-aws/sdk/v7/go/aws/:
| Category | Services |
|---|---|
| Compute | ec2, lambda, ecs, eks, autoscaling, batch, lightsail |
| Storage | s3, ebs, efs, glacier, storagegateway, backup |
| Database | rds, dynamodb, elasticache, neptune, memorydb, dax |
| Networking | vpc, lb, route53, cloudfront, apigateway, directconnect |
| Security | iam, kms, secretsmanager, guardduty, securityhub, waf |
| Messaging | sns, sqs, kinesis, eventbridge (cloudwatch), mq, msk |
| Analytics | athena, emr, glue, quicksight, opensearch, redshift |
| ML/AI | sagemaker, bedrock, comprehend, rekognition, transcribe |
| Developer Tools | codebuild, codedeploy, codecommit, codepipeline |
| Management | cloudformation, cloudwatch, cloudtrail, ssm, config |
→ Complete Service Package List
All resource constructors return (resource, error):
resource, err := service.NewResource(ctx, "name", &service.ResourceArgs{})
if err != nil {
return err // Return from pulumi.Run callback
}| Task | Documentation |
|---|---|
| Configure AWS credentials | Provider Reference |
| Create VPC with subnets | EC2 Reference |
| Deploy Lambda function | Lambda Reference |
| Set up S3 bucket | S3 Reference |
| Create RDS database | RDS Reference |
| Configure IAM roles | IAM Reference |
| Deploy container service | ECS Reference |
| Set up Kubernetes cluster | EKS Reference |
| Create API Gateway | API Gateway Reference |
| Query account/region info | Core Data Sources |
┌─────────────────────────────────────────────────────────┐
│ Pulumi AWS Provider │
│ │
│ Provider Config ──→ Resources ──→ AWS Cloud │
│ ↓ ↓ │
│ Authentication Dependencies │
│ Region Outputs │
│ Tags │
└─────────────────────────────────────────────────────────┘Deploy serverless API → Example
Deploy static website with CDN → Example
Deploy containerized application → Example
Create network infrastructure → Example
For detailed API specifications, comprehensive examples, and advanced patterns, explore the Reference Documentation.
Install with Tessl CLI
npx tessl i tessl/golang-github-com-pulumi-pulumi-aws-sdk-v7docs