diff --git a/examples/examples_nodejs_test.go b/examples/examples_nodejs_test.go index 7febc44f383..8a4bd5c3f19 100644 --- a/examples/examples_nodejs_test.go +++ b/examples/examples_nodejs_test.go @@ -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) } diff --git a/examples/regress-1423/Pulumi.yaml b/examples/regress-1423/Pulumi.yaml new file mode 100644 index 00000000000..c3597f2a022 --- /dev/null +++ b/examples/regress-1423/Pulumi.yaml @@ -0,0 +1,3 @@ +name: regress-1423 +runtime: nodejs +description: Regress pulumi/pulumi-aws#1423 diff --git a/examples/regress-1423/index.ts b/examples/regress-1423/index.ts new file mode 100644 index 00000000000..ee9a646f302 --- /dev/null +++ b/examples/regress-1423/index.ts @@ -0,0 +1,52 @@ +// 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 pulumi from "@pulumi/pulumi"; +import * as aws from "@pulumi/aws"; + +const config = new pulumi.Config("aws"); +const provider = new aws.Provider("prov", + { region: config.require("envRegion") }); + + +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, + } + }] +}, { provider }); diff --git a/examples/regress-1423/package.json b/examples/regress-1423/package.json new file mode 100644 index 00000000000..4ba8967a924 --- /dev/null +++ b/examples/regress-1423/package.json @@ -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" + } +} diff --git a/examples/regress-1423/tsconfig.json b/examples/regress-1423/tsconfig.json new file mode 100644 index 00000000000..ab65afa6135 --- /dev/null +++ b/examples/regress-1423/tsconfig.json @@ -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" + ] +} diff --git a/provider/resources.go b/provider/resources.go index 872e2ff2d22..797203a8f28 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -7135,5 +7135,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 }