Skip to content

Commit

Permalink
Upgrade to v4.0.0 of the AWS Terraform Provider
Browse files Browse the repository at this point in the history
Please Note: In the upstream provider, the AWS S3 Bucket resource has changed.
While we appreciate the work that has has been done there, we want to ensure that
our Pulumi users continue to be able to work with the existing S3 bucket resource
without any problems. We will publish a guide on how to migrate from `aws.s3.Bucket`
to `aws.s3.BucketV2` to help with this effort.

A number of other breaking changes have been made **outside of the S3 Bucket resource**.
You can find more about these changes in the [upstream provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade).
  • Loading branch information
stack72 committed Mar 16, 2022
1 parent 7eb5008 commit f73d82b
Show file tree
Hide file tree
Showing 7,514 changed files with 120,227 additions and 58,395 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .github/workflows/master.yml
Expand Up @@ -13,6 +13,7 @@ env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TRAVIS_OS_NAME: linux
VERSION_PREFIX: 5.0.0
jobs:
build_sdk:
name: build_sdk
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly-test.yml
Expand Up @@ -13,6 +13,7 @@ env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TRAVIS_OS_NAME: linux
VERSION_PREFIX: 5.0.0
jobs:
build_sdk:
name: build_sdk
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-acceptance-tests.yml
Expand Up @@ -14,6 +14,7 @@ env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TRAVIS_OS_NAME: linux
VERSION_PREFIX: 5.0.0
jobs:
build_sdk:
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-bridge.yml
Expand Up @@ -2,6 +2,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_EXTRA_MAPPING_ERROR: false
PULUMI_MISSING_MAPPING_ERROR: false
VERSION_PREFIX: 5.0.0
jobs:
update_bridge:
name: update-bridge
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-upstream-provider.yml
Expand Up @@ -18,6 +18,7 @@ env:
UPSTREAM_PROVIDER_MAJOR_VERSION: ""
UPSTREAM_PROVIDER_ORG: pulumi
UPSTREAM_PROVIDER_REPO: terraform-provider-aws
VERSION_PREFIX: 5.0.0
jobs:
update_upstream_provider:
name: update-upstream_provider
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Expand Up @@ -3,8 +3,8 @@ ORG := pulumi
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @pulumi/${PACK}
TF_NAME := ${PACK}
PROVIDER_PATH := provider/v4
SDK_PATH := sdk/v4
PROVIDER_PATH := provider/v5
SDK_PATH := sdk/v5
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version

TFGEN := pulumi-tfgen-${PACK}
Expand Down Expand Up @@ -86,9 +86,10 @@ clean::

install_plugins::
[ -x $(shell which pulumi) ] || curl -fsSL https://get.pulumi.com | sh
pulumi plugin install resource tls 4.0.0
pulumi plugin install resource github 4.6.0
pulumi plugin install resource kubernetes 3.8.3
pulumi plugin install resource tls
pulumi plugin install resource github
pulumi plugin install resource kubernetes
pulumi plugin install resource random

install_dotnet_sdk::
mkdir -p $(WORKING_DIR)/nuget
Expand Down
2 changes: 2 additions & 0 deletions examples/examples_go_test.go
@@ -1,4 +1,5 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//go:build go || all
// +build go all

package examples
Expand All @@ -11,6 +12,7 @@ import (
)

func TestAccWebserverGo(t *testing.T) {
t.Skipf("Skip while running a provider upgrade")
test := integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "webserver-go"),
Dependencies: []string{
Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod
@@ -1,4 +1,4 @@
module github.com/pulumi/pulumi-aws/examples/v4
module github.com/pulumi/pulumi-aws/examples/v5

go 1.16

Expand Down
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-aws/main.go
Expand Up @@ -17,8 +17,8 @@
package main

import (
aws "github.com/pulumi/pulumi-aws/provider/v4"
"github.com/pulumi/pulumi-aws/provider/v4/pkg/version"
aws "github.com/pulumi/pulumi-aws/provider/v5"
"github.com/pulumi/pulumi-aws/provider/v5/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
)

Expand Down
16,098 changes: 10,894 additions & 5,204 deletions provider/cmd/pulumi-resource-aws/schema.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions provider/cmd/pulumi-tfgen-aws/main.go
Expand Up @@ -15,8 +15,8 @@
package main

import (
aws "github.com/pulumi/pulumi-aws/provider/v4"
"github.com/pulumi/pulumi-aws/provider/v4/pkg/version"
aws "github.com/pulumi/pulumi-aws/provider/v5"
"github.com/pulumi/pulumi-aws/provider/v5/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen"
)

Expand Down
6 changes: 3 additions & 3 deletions provider/go.mod
@@ -1,4 +1,4 @@
module github.com/pulumi/pulumi-aws/provider/v4
module github.com/pulumi/pulumi-aws/provider/v5

go 1.16

Expand All @@ -12,8 +12,8 @@ require (
)

replace (
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20210629210550-59d24255d71f
github.com/hashicorp/terraform-provider-aws => github.com/pulumi/terraform-provider-aws v1.38.1-0.20220310114353-ce4b7cb805ba
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20211230170131-3a7c83bfab87
github.com/hashicorp/terraform-provider-aws => github.com/pulumi/terraform-provider-aws v1.38.1-0.20220307112522-c946ee2dee2b
github.com/hashicorp/terraform-provider-aws/shim => ./shim
github.com/hashicorp/vault => github.com/hashicorp/vault v1.2.0
)
79 changes: 59 additions & 20 deletions provider/go.sum

Large diffs are not rendered by default.

76 changes: 30 additions & 46 deletions provider/resources.go
Expand Up @@ -26,7 +26,7 @@ import (
awsbase "github.com/hashicorp/aws-sdk-go-base"
awsShim "github.com/hashicorp/terraform-provider-aws/shim"
homedir "github.com/mitchellh/go-homedir"
"github.com/pulumi/pulumi-aws/provider/v4/pkg/version"
"github.com/pulumi/pulumi-aws/provider/v5/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
Expand Down Expand Up @@ -413,14 +413,7 @@ func Provider() tfbridge.ProviderInfo {
"aws_appmesh_gateway_route": {Tok: awsResource(appmeshMod, "GatewayRoute")},
"aws_appmesh_virtual_gateway": {Tok: awsResource(appmeshMod, "VirtualGateway")},
// API Gateway
"aws_api_gateway_account": {
Tok: awsResource(apigatewayMod, "Account"),
Fields: map[string]*tfbridge.SchemaInfo{
"throttle_settings": {
MaxItemsOne: boolRef(true),
},
},
},
"aws_api_gateway_account": {Tok: awsResource(apigatewayMod, "Account")},
"aws_api_gateway_api_key": {
Tok: awsResource(apigatewayMod, "ApiKey"),
Fields: map[string]*tfbridge.SchemaInfo{
Expand Down Expand Up @@ -898,14 +891,7 @@ func Provider() tfbridge.ProviderInfo {
Tok: awsResource(codecommitMod, "ApprovalRuleTemplateAssociation"),
},
// CodePipeline
"aws_codepipeline": {
Tok: awsResource(codepipelineMod, "Pipeline"),
Fields: map[string]*tfbridge.SchemaInfo{
"artifact_store": {
MaxItemsOne: boolRef(true),
},
},
},
"aws_codepipeline": {Tok: awsResource(codepipelineMod, "Pipeline")},
"aws_codepipeline_webhook": {Tok: awsResource(codepipelineMod, "Webhook")},

// Cognito
Expand All @@ -919,6 +905,7 @@ func Provider() tfbridge.ProviderInfo {
"aws_cognito_user_pool_domain": {Tok: awsResource(cognitoMod, "UserPoolDomain")},
"aws_cognito_user_pool_ui_customization": {Tok: awsResource(cognitoMod, "UserPoolUICustomization")},
"aws_cognito_identity_pool_provider_principal_tag": {Tok: awsResource(cognitoMod, "IdentityPoolProviderPrincipalTag")},
"aws_cognito_user": {Tok: awsResource(cognitoMod, "User")},

// Connect
"aws_connect_contact_flow": {Tok: awsResource(connectMod, "ContactFlow")},
Expand Down Expand Up @@ -948,6 +935,7 @@ func Provider() tfbridge.ProviderInfo {

// DataExchange
"aws_dataexchange_data_set": {Tok: awsResource(dataexchangeMod, "DataSet")},
"aws_dataexchange_revision": {Tok: awsResource(dataexchangeMod, "Revision")},

// Datapipeline
"aws_datapipeline_pipeline_definition": {Tok: awsResource(datapipelineMod, "PipelineDefinition")},
Expand Down Expand Up @@ -1236,6 +1224,7 @@ func Provider() tfbridge.ProviderInfo {
},
},
"aws_network_acl_rule": {Tok: awsResource(ec2Mod, "NetworkAclRule")},
"aws_network_acl_association": {Tok: awsResource(ec2Mod, "NetworkAclAssociation")},
"aws_network_interface": {Tok: awsResource(ec2Mod, "NetworkInterface")},
"aws_network_interface_attachment": {Tok: awsResource(ec2Mod, "NetworkInterfaceAttachment")},
"aws_placement_group": {
Expand Down Expand Up @@ -1436,13 +1425,6 @@ func Provider() tfbridge.ProviderInfo {
Fields: map[string]*tfbridge.SchemaInfo{
"replication_configuration": {
CSharpName: "ReplicationConfigurationDetails",
Elem: &tfbridge.SchemaInfo{
Fields: map[string]*tfbridge.SchemaInfo{
"rule": {
MaxItemsOne: tfbridge.True(),
},
},
},
},
},
},
Expand Down Expand Up @@ -1486,9 +1468,6 @@ func Provider() tfbridge.ProviderInfo {
Tok: awsResource(efsMod, "FileSystem"),
Fields: map[string]*tfbridge.SchemaInfo{
"creation_token": tfbridge.AutoName("creationToken", 255, "-"),
"lifecycle_policy": {
MaxItemsOne: boolRef(true),
},
},
},
"aws_efs_mount_target": {
Expand All @@ -1506,14 +1485,7 @@ func Provider() tfbridge.ProviderInfo {
},
},
// ECS for Kubernetes
"aws_eks_cluster": {
Tok: awsResource(eksMod, "Cluster"),
Fields: map[string]*tfbridge.SchemaInfo{
"certificate_authority": {
MaxItemsOne: boolRef(true),
},
},
},
"aws_eks_cluster": {Tok: awsResource(eksMod, "Cluster")},
"aws_eks_node_group": {
Tok: awsResource(eksMod, "NodeGroup"),
Fields: map[string]*tfbridge.SchemaInfo{
Expand Down Expand Up @@ -2435,8 +2407,20 @@ func Provider() tfbridge.ProviderInfo {
"aws_shield_protection_health_check_association": {Tok: awsResource(shieldMod, "ProtectionHealthCheckAssociation")},

// S3
"aws_s3_account_public_access_block": {Tok: awsResource(s3Mod, "AccountPublicAccessBlock")},
"aws_s3_bucket": {
"aws_s3_account_public_access_block": {Tok: awsResource(s3Mod, "AccountPublicAccessBlock")},
"aws_s3_bucket": {Tok: awsResource(s3Mod, "BucketV2")},
"aws_s3_bucket_accelerate_configuration": {Tok: awsResource(s3Mod, "BucketAccelerateConfigurationV2")},
"aws_s3_bucket_acl": {Tok: awsResource(s3Mod, "BucketAclV2")},
"aws_s3_bucket_cors_configuration": {Tok: awsResource(s3Mod, "BucketCorsConfigurationV2")},
"aws_s3_bucket_lifecycle_configuration": {Tok: awsResource(s3Mod, "BucketLifecycleConfigurationV2")},
"aws_s3_bucket_logging": {Tok: awsResource(s3Mod, "BucketLoggingV2")},
"aws_s3_bucket_object_lock_configuration": {Tok: awsResource(s3Mod, "BucketObjectLockConfigurationV2")},
"aws_s3_bucket_request_payment_configuration": {Tok: awsResource(s3Mod, "BucketRequestPaymentConfigurationV2")},
"aws_s3_bucket_server_side_encryption_configuration": {Tok: awsResource(s3Mod, "BucketServerSideEncryptionConfigurationV2")},
"aws_s3_bucket_versioning": {Tok: awsResource(s3Mod, "BucketVersioningV2")},
"aws_s3_bucket_website_configuration": {Tok: awsResource(s3Mod, "BucketWebsiteConfigurationV2")},
"aws_s3_object": {Tok: awsResource(s3Mod, "BucketObjectv2")},
"aws_s3_bucket_legacy": {
Tok: awsResource(s3Mod, "Bucket"),
Fields: map[string]*tfbridge.SchemaInfo{
"acl": {
Expand Down Expand Up @@ -4053,14 +4037,7 @@ func Provider() tfbridge.ProviderInfo {
"aws_cloudformation_export": {Tok: awsDataSource(cloudformationMod, "getExport")},
"aws_cloudformation_type": {Tok: awsDataSource(cloudformationMod, "getCloudFormationType")},
// CloudHSM
"aws_cloudhsm_v2_cluster": {
Tok: awsDataSource(cloudhsmv2Mod, "getCluster"),
Fields: map[string]*tfbridge.SchemaInfo{
"cluster_certificates": {
MaxItemsOne: boolRef(true),
},
},
},
"aws_cloudhsm_v2_cluster": {Tok: awsDataSource(cloudhsmv2Mod, "getCluster")},
// CloudTrail
"aws_cloudtrail_service_account": {Tok: awsDataSource(cloudtrailMod, "getServiceAccount")},
// CloudWatch
Expand Down Expand Up @@ -4181,6 +4158,10 @@ func Provider() tfbridge.ProviderInfo {
"aws_ec2_instance_types": {Tok: awsDataSource(ec2Mod, "getInstanceTypes")},
"aws_vpc_ipam_pool": {Tok: awsDataSource(ec2Mod, "getVpcIamPool")},
"aws_vpc_ipam_preview_next_cidr": {Tok: awsDataSource(ec2Mod, "getIpamPreviewNextCidr")},
"aws_eips": {Tok: awsDataSource(ec2Mod, "getEips")},

// Ec2 Client
"aws_ec2_client_vpn_endpoint": {Tok: awsDataSource(ec2ClientVpnMod, "getEndpoint")},

// EC2 Transit Gateway
"aws_ec2_transit_gateway": {Tok: awsDataSource(ec2TransitGatewayMod, "getTransitGateway")},
Expand Down Expand Up @@ -4367,6 +4348,8 @@ func Provider() tfbridge.ProviderInfo {
"aws_s3_bucket": {Tok: awsDataSource(s3Mod, "getBucket")},
"aws_s3_bucket_object": {Tok: awsDataSource(s3Mod, "getBucketObject")},
"aws_s3_bucket_objects": {Tok: awsDataSource(s3Mod, "getBucketObjects")},
"aws_s3_object": {Tok: awsDataSource(s3Mod, "getObject")},
"aws_s3_objects": {Tok: awsDataSource(s3Mod, "getObjects")},
// Secrets Manager
"aws_secretsmanager_secret": {Tok: awsDataSource(secretsmanagerMod, "getSecret")},
"aws_secretsmanager_secret_version": {Tok: awsDataSource(secretsmanagerMod, "getSecretVersion")},
Expand Down Expand Up @@ -4438,6 +4421,7 @@ func Provider() tfbridge.ProviderInfo {
},
"aws_cloudfront_response_headers_policy": {Tok: awsDataSource(cloudfrontMod, "getResponseHeadersPolicy")},
"aws_cloudfront_origin_access_identity": {Tok: awsDataSource(cloudfrontMod, "getOriginAccessIdentity")},
"aws_cloudfront_realtime_log_config": {Tok: awsDataSource(cloudfrontMod, "getRealtimeLogConfig")},

// Backup
"aws_backup_plan": {Tok: awsDataSource(backupMod, "getPlan")},
Expand Down Expand Up @@ -4854,7 +4838,7 @@ func Provider() tfbridge.ProviderInfo {
prov.SetAutonaming(255, "-")

// Add a CSharp-specific override for aws_s3_bucket.bucket.
prov.Resources["aws_s3_bucket"].Fields["bucket"].CSharpName = "BucketName"
prov.Resources["aws_s3_bucket_legacy"].Fields["bucket"].CSharpName = "BucketName"

return prov
}
Expand Down
2 changes: 1 addition & 1 deletion provider/shim/go.mod
Expand Up @@ -7,4 +7,4 @@ require (
github.com/hashicorp/terraform-provider-aws v1.60.1-0.20211105002759-77bad27d9f23
)

replace github.com/hashicorp/terraform-provider-aws => github.com/pulumi/terraform-provider-aws v1.38.1-0.20220310114353-ce4b7cb805ba
replace github.com/hashicorp/terraform-provider-aws => github.com/pulumi/terraform-provider-aws v1.38.1-0.20220307112522-c946ee2dee2b

0 comments on commit f73d82b

Please sign in to comment.