Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PRC by default in AWS #4403

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/examples_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ func (st tagsState) expectedTags() map[string]string {
return r
}

func normTags(tags map[string]string) map[string]string {
if tags == nil {
return map[string]string{}
}
return tags
}

type tagsFetcher = func() (map[string]string, error)

func (st tagsState) assertTagsEqualWithRetry(
Expand All @@ -214,7 +221,7 @@ func (st tagsState) assertTagsEqualWithRetry(
for attempt := 0; attempt < 10; attempt++ {
var err error = nil
actualTags, err = getActualTags()
if err == nil && assert.ObjectsAreEqual(expectTags, actualTags) {
if err == nil && assert.ObjectsAreEqual(normTags(expectTags), normTags(actualTags)) {
break
}
if err != nil {
Expand All @@ -226,7 +233,7 @@ func (st tagsState) assertTagsEqualWithRetry(
time.Sleep(5 * time.Second)
t.Logf("Trying to fetch tags again, attempt %d", attempt+1)
}
require.Equalf(t, expectTags, actualTags, msg)
require.Equalf(t, normTags(expectTags), normTags(actualTags), msg)
}

func (st tagsState) validateStateResult(phase int) func(
Expand All @@ -247,7 +254,7 @@ func (st tagsState) validateStateResult(phase int) func(
require.NoError(t, err)
t.Logf("phase: %d", phase)
t.Logf("state: %v", st.serialize(t))
require.Equalf(t, st.expectedTags(), actualTags, "key=%s", k)
require.Equalf(t, normTags(st.expectedTags()), normTags(actualTags), "key=%s", k)
t.Logf("key=%s tags are as expected: %v", k, actualTagsJSON)

if k == "bucket" {
Expand Down
2 changes: 2 additions & 0 deletions examples/examples_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ func TestMigrateRdsInstance(t *testing.T) {
"__meta": "{\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":2400000000000,\"delete\":3600000000000,\"update\":4800000000000},\"schema_version\":\"1\"}",
"address": "rds2f5ed54.c1xxca33i6kr.us-east-2.rds.amazonaws.com",
"allocatedStorage": 16,
"applyImmediately": false,
"arn": "arn:aws:rds:us-east-2:616138583583:db:rds2f5ed54",
"autoMinorVersionUpgrade": true,
"availabilityZone": "us-east-2c",
Expand Down Expand Up @@ -670,6 +671,7 @@ func TestMigrateRdsInstance(t *testing.T) {
"__meta": "{\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":2400000000000,\"delete\":3600000000000,\"update\":4800000000000},\"schema_version\":\"1\"}",
"address": "rds2f5ed54.c1xxca33i6kr.us-east-2.rds.amazonaws.com",
"allocatedStorage": 16,
"applyImmediately": false,
"arn": "arn:aws:rds:us-east-2:616138583583:db:rds2f5ed54",
"autoMinorVersionUpgrade": true,
"availabilityZone": "us-east-2c",
Expand Down
17 changes: 3 additions & 14 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,20 +819,8 @@ func ProviderFromMeta(metaInfo *tfbridge.MetadataInfo) *tfbridge.ProviderInfo {

v2p := shimv2.NewProvider(upstreamProvider.SDKV2Provider,
shimv2.WithDiffStrategy(shimv2.PlanState),
shimv2.WithPlanResourceChange(func(s string) bool {
switch s {
case "aws_ssm_document",
"aws_wafv2_web_acl",
"aws_wafv2_rule_group",
"aws_batch_job_definition",
"aws_lb_listener",
"aws_lb_listener_rule",
"aws_alb_listener",
"aws_alb_listener_rule":
return true
default:
return false
}
shimv2.WithPlanResourceChange(func(string) bool {
return true
}))

p := pftfbridge.MuxShimWithDisjointgPF(ctx, v2p, upstreamProvider.PluginFrameworkProvider)
Expand Down Expand Up @@ -5333,6 +5321,7 @@ compatibility shim in favor of the new "name" field.`)
},
Namespaces: namespaceMap,
},
EnableZeroDefaultSchemaVersion: true,
}

rAlias := func(token string, prev, current tokens.Type, info *tfbridge.ResourceInfo) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"manifest": {
"time": "2024-08-28T10:55:18.06234+01:00",
"magic": "59ab42470ec682a2eb8566128a64ecaee8e5d25c6d5902576977eb325cf4d7b3",
"version": "v3.130.0"
},
"config": {
"aws:region": "us-east-2"
},
"manifest": {
"time": "2024-06-21T11:53:56.242051-04:00",
"magic": "26455f4e783faab27da6c6ee2e252716b1c84e7f67777a274faa7d2452f68cf7",
"version": "v3.120.0"
},
"resourcePlans": {
"urn:pulumi:test::openzfs::aws:ec2/subnet:Subnet::MySubnet": {
"goal": {
Expand Down Expand Up @@ -52,16 +52,29 @@
"create"
],
"state": {
"__meta": "{\"_new_extra_shim\":{},\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":600000000000,\"delete\":1200000000000}}",
"arn": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"assignIpv6AddressOnCreation": false,
"availabilityZone": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"availabilityZoneId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"cidrBlock": "10.0.1.0/24",
"customerOwnedIpv4Pool": null,
"enableDns64": false,
"enableLniAtDeviceIndex": null,
"enableResourceNameDnsARecordOnLaunch": false,
"enableResourceNameDnsAaaaRecordOnLaunch": false,
"id": "",
"id": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ipv6CidrBlock": null,
"ipv6CidrBlockAssociationId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ipv6Native": false,
"mapPublicIpOnLaunch": false
"mapCustomerOwnedIpOnLaunch": null,
"mapPublicIpOnLaunch": false,
"outpostArn": null,
"ownerId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"privateDnsHostnameTypeOnLaunch": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"vpcId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9"
},
"seed": "A/8WUtf+VHqLjHFCAuMN/H4nGq+hqtjY6QEh8Os/gL4="
"seed": "jVbviX6tLd0yo1zAT6cHjeYo9zoCVQLaL0klusIpqDM="
},
"urn:pulumi:test::openzfs::aws:ec2/vpc:Vpc::MyVPC": {
"goal": {
Expand Down Expand Up @@ -90,12 +103,29 @@
"create"
],
"state": {
"arn": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"assignGeneratedIpv6CidrBlock": null,
"cidrBlock": "10.0.0.0/16",
"defaultNetworkAclId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"defaultRouteTableId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"defaultSecurityGroupId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"dhcpOptionsId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"enableDnsHostnames": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"enableDnsSupport": true,
"id": "",
"instanceTenancy": "default"
"enableNetworkAddressUsageMetrics": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"id": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"instanceTenancy": "default",
"ipv4IpamPoolId": null,
"ipv4NetmaskLength": null,
"ipv6AssociationId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ipv6CidrBlock": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ipv6CidrBlockNetworkBorderGroup": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ipv6IpamPoolId": null,
"ipv6NetmaskLength": null,
"mainRouteTableId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ownerId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9"
},
"seed": "HRRxtNXyCA/albslvw9oRcNpmS+ZdRFdAcgnfB8FoIE="
"seed": "2y7HlC8cCdGzxTqSoVpRwDpKtdWckb53R4zcyAz/odk="
},
"urn:pulumi:test::openzfs::aws:fsx/openZfsFileSystem:OpenZfsFileSystem::MyFileSystem": {
"goal": {
Expand Down Expand Up @@ -145,17 +175,38 @@
"create"
],
"state": {
"__meta": "{\"_new_extra_shim\":{},\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":3600000000000,\"delete\":3600000000000,\"update\":3600000000000}}",
"arn": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"automaticBackupRetentionDays": 0,
"backupId": null,
"copyTagsToBackups": false,
"copyTagsToVolumes": false,
"dailyAutomaticBackupStartTime": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"deleteOptions": null,
"deploymentType": "SINGLE_AZ_1",
"id": "",
"diskIopsConfiguration": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"dnsName": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"endpointIpAddress": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"endpointIpAddressRange": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"finalBackupTags": null,
"id": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"kmsKeyId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"networkInterfaceIds": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"ownerId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"preferredSubnetId": null,
"rootVolumeConfiguration": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"rootVolumeId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"routeTableIds": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"securityGroupIds": null,
"skipFinalBackup": false,
"storageCapacity": 64,
"storageType": "SSD",
"throughputCapacity": 64
"subnetIds": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"throughputCapacity": 64,
"vpcId": "04da6b54-80e4-46f7-96ec-b56ff0331ba9",
"weeklyMaintenanceStartTime": "04da6b54-80e4-46f7-96ec-b56ff0331ba9"
},
"seed": "NS4cTu4tsZzJ3zXCCYZ4HRNa+pvgcsfy8WCM1CXgaZM="
"seed": "0s+0wM6MlNBQWWeGJq+RPJG59yJWeBUn5Y3iChwx7ds="
},
"urn:pulumi:test::openzfs::pulumi:providers:aws::default": {
"goal": {
Expand All @@ -181,7 +232,7 @@
"skipCredentialsValidation": "false",
"skipRegionValidation": "true"
},
"seed": "JSoHt3w+sEo4jC1wjZar653mfk7+3s9KJhvV186L+Zs="
"seed": "P7e3NwkTiq1KjpRIeyhpwdalaUH5DxN2cphLiJo5IjY="
},
"urn:pulumi:test::openzfs::pulumi:pulumi:Stack::openzfs-test": {
"goal": {
Expand All @@ -197,7 +248,7 @@
"create"
],
"state": {},
"seed": "O8GPxHK8Ggd/nl1FsTnBkwVPMj0BPEyPFbDKEnhS3iQ="
"seed": "XgKFfV/aFt4GXqWlV8zHoLDOGPU6vgN517bCZ1RpuRI="
}
}
}
Loading