WAFV2 with Go doesn't seem to import resources correctly #725
Labels
area/import
impact/usability
Something that impacts users' ability to use the product easily and intuitively
kind/bug
Some behavior is incorrect or out of spec
What happened?
My goal was to import and codify an AWS WAF resource. After the resource was successfully imported and failed to generate code as mentioned in pulumi/pulumi#11552, I generated code with AWS Classic provider and manually converted it into AWS Native. After running
pulumi up
I noticed a number of changes, which didn't make a lot of sense. Consulting the actual imported state withpulumi stack export
compared with JSON representation of the WAF configuration (downloaded fron AWS console) I noticed some properties were not present in the actual WAF JSON, but were present in the imported state, those were reported as changes which will result in removal.Steps to reproduce
Expected Behavior
Pulumi would import the WebACL resource as it is in AWS, without any extra properties
Actual Behavior
Pulumi imported the WebACL resource with extra properties and now reports unnecessary changes
Examples:
In the state:
In AWS:
pulumi diff:
After adding the searchStringBase64 property to the code to remove the diff
I have found similar issues with other parameters as well, some of them are
ruleLabels
,excludedRules
,managedRuleGroupConfigs
,excludedCookies
,includedCookies
,excludedHeaders
,includedHeaders
,tags
, and probably others that I've missed.Output of
pulumi about
CLI
Version 3.48.0
Go Version go1.19.2
Go Compiler gc
Plugins
NAME VERSION
aws 5.21.1
aws-native 0.43.0
go unknown
Host
OS ubuntu
Version 20.04
Arch x86_64
This project is written in go: executable='/usr/local/go/bin/go' version='go version go1.19.2 linux/amd64'
Found no pending operations associated with xxx/prod
Backend
Name pulumi.com
URL https://app.pulumi.com/xxx
User xxx
Organizations xxx, xxx
Dependencies:
NAME VERSION
github.com/pulumi/pulumi-aws-native/sdk 0.43.0
github.com/pulumi/pulumi-aws/sdk/v5 5.21.1
github.com/pulumi/pulumi/sdk/v3 3.48.0
pkg/database 0.0.0-00010101000000-000000000000
pkg/environment 0.0.0-00010101000000-000000000000
pkg/nfs 0.0.0-00010101000000-000000000000
Additional context
I first attempted to use AWS Classic provider for this, but I unfortunately reached a dead end as reported here: pulumi/pulumi-aws#2250
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: