Skip to content

Instantly share code, notes, and snippets.

@iamjohnnym
Created February 21, 2020 21:13
Show Gist options
  • Select an option

  • Save iamjohnnym/3eff7bbffaefebd94c32a58ef8ed4a1b to your computer and use it in GitHub Desktop.

Select an option

Save iamjohnnym/3eff7bbffaefebd94c32a58ef8ed4a1b to your computer and use it in GitHub Desktop.

Revisions

  1. iamjohnnym created this gist Feb 21, 2020.
    40 changes: 40 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    import pulumi
    import pulumi_aws
    from localstack_endpoints import localstack_endpoints as endpoints

    aws = pulumi_aws.Provider(
    'localstack',
    skip_credentials_validation=True,
    skip_metadata_api_check=True,
    s3_force_path_style=True,
    access_key="mockAccessKey",
    secret_key="mockSecretKey",
    region='us-east-1',
    endpoints=[{
    'apigateway': endpoints['APIGateway'],
    'cloudformation': endpoints['CloudFormation'],
    'cloudwatch': endpoints['CloudWatch'],
    'cloudwatchlogs': endpoints['CloudWatchLogs'],
    'dynamodb': endpoints['DynamoDB'],
    'es': endpoints['ES'],
    'firehose': endpoints['Firehose'],
    'iam': endpoints['IAM'],
    'kinesis': endpoints['Kinesis'],
    'kms': endpoints['KMS'],
    'route53': endpoints['Route53'],
    'redshift': endpoints['Redshift'],
    's3': endpoints['S3'],
    'ses': endpoints['SES'],
    'sns': endpoints['SNS'],
    'sqs': endpoints['SQS'],
    'ssm': endpoints['SSM'],
    'sts': endpoints['STS'],
    }],
    )

    from pulumi_aws import s3
    # Create an AWS resource (S3 Bucket)
    bucket = s3.Bucket('my-bucket')

    # Export the name of the bucket
    pulumi.export('bucket_name', bucket.id)