Skip to content

Commit

Permalink
Fix pulumi-aws#1423
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Jul 7, 2023
1 parent 725401a commit 8720cec
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,18 @@ func TestAccWafV2(t *testing.T) {
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "wafv2"),
})
integration.ProgramTest(t, &test)
}

func TestRegress1423Ts(t *testing.T) {
test := getJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "regress-1423"),
RunUpdateTest: false,
})
test.ExpectRefreshChanges = false
test.Quick = false
test.SkipRefresh = false
integration.ProgramTest(t, &test)
}

Expand Down
3 changes: 3 additions & 0 deletions examples/regress-1423/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: regress-1423
runtime: nodejs
description: Regress pulumi/pulumi-aws#1423
46 changes: 46 additions & 0 deletions examples/regress-1423/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2016-2023, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as aws from "@pulumi/aws";

new aws.wafv2.WebAcl("web-acl", {
defaultAction: {
block: {},
},
scope: "REGIONAL",
visibilityConfig: {
cloudwatchMetricsEnabled: false,
metricName: "josh-test",
sampledRequestsEnabled: true,
},
rules: [{
name: "test-aws-rules",
overrideAction: {
count: {},
},
priority: 1,
statement: {
managedRuleGroupStatement: {
vendorName: "AWS",
name: "AWSManagedRulesCommonRuleSet",
version: "Version_1.3",
},
},
visibilityConfig: {
cloudwatchMetricsEnabled: false,
metricName: "test-aws-rules",
sampledRequestsEnabled: true,
}
}]
});
16 changes: 16 additions & 0 deletions examples/regress-1423/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "regress-1423",
"version": "0.0.1",
"license": "Apache-2.0",
"scripts": {
"build": "tsc"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/aws": "^5.0.0"
},
"devDependencies": {
"@types/aws-sdk": "^2.7.0",
"@types/node": "^8.0.0"
}
}
18 changes: 18 additions & 0 deletions examples/regress-1423/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.ts"
]
}
3 changes: 3 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -7126,5 +7126,8 @@ func Provider() *tfbridge.ProviderInfo {
args.ExamplePath == "#/resources/aws:appsync/graphQLApi:GraphQLApi"
}

// Fixes a spurious diff on repeat pulumi up for the aws_wafv2_web_acl resource (pulumi/pulumi#1423).
shimv2.SetInstanceStateStrategy(prov.P.ResourcesMap().Get("aws_wafv2_web_acl"), shimv2.CtyInstanceState)

return &prov
}

0 comments on commit 8720cec

Please sign in to comment.