:wave: Hi Team. I'm upgrading from Pulumi.Aws v6 ...
# dotnet
g
👋 Hi Team. I'm upgrading from Pulumi.Aws v6 to v7 following the migration guide, but I'm running into a number of undocumented breaking changes (build errors). One example:
WebAclRuleStatementRateBasedStatementScopeDownStatementArgs
no longer has a
NotStatement
property. Anyone else see this? Am I missing a step?
🙌 1
l
Hey Mat, can you please describe what version you are starting at and the steps that you've taken so far?
g
I'm coming from v6.83.4 and moving to v7.35.0. After updating the nuget package I tried to run dotnet build, but it now fails
l
I think you've hit a schema generation issue rather than an API issue. It seems like the depth of Wafv2 is limited to just 3 levels of nested statements and
WebAclRuleStatementRateBasedStatementScopeDownStatementArgs
might be more. One solution you can try is to use pulumi.com/registry/…/webacl#… for more rested configurations
g
I don't think it's a nesting issue, though maybe i'm mis-understanding. I've tried using the WebAclRule as well as inline rules. I'd prefer not to convert to RulesJson due to their limitations, plus this used to work fine without RulesJson. I've created a simplified example. This compiled and ran in v6, but doesn't even compile in v7 It's a webAcl with 1 rule. A rateBased rule with a prefix that's exempt. Thanks for your help cc: @@billowy-telephone-40262
Copy code
var name = "test-acl";
		var webacl = new Pulumi.Aws.WafV2.WebAcl($"webacl", new(){
			Name=name,
			Scope="CLOUDFRONT",
			VisibilityConfig = new WebAclVisibilityConfigArgs {
				CloudwatchMetricsEnabled = true,
				SampledRequestsEnabled = true,
				MetricName = name,
			},
			DefaultAction = new WebAclDefaultActionArgs{
				Allow = new WebAclDefaultActionAllowArgs(),
			},
			Tags = new() {
				["ManagedBy"]="Pulumi"
			},
		}, new()
		{
			// see: <https://www.pulumi.com/registry/packages/aws/api-docs/wafv2/webaclrule/>
			// We're using WebAclRule resources instead of the inline rules property on the webacl
			IgnoreChanges = ["rules"],
		});

		var ruleName = "thisUsedToWork";
		var rule = new Pulumi.Aws.WafV2.WebAclRule("rule1", new()
		{
			Name=ruleName,
            WebAclArn = webacl.Arn,
			Priority=1,
			Action = new WebAclRuleActionArgs{
				Block = new WebAclRuleActionBlockArgs() {}
			},
			Statement = new WebAclRuleStatementArgs {
				RateBasedStatement = new WebAclRuleStatementRateBasedStatementArgs {
					Limit = 1000,
					EvaluationWindowSec = 60,
					AggregateKeyType = "IP",
					ScopeDownStatement = new WebAclRuleStatementRateBasedStatementScopeDownStatementArgs {
						NotStatement = new WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementArgs {
							Statements = new WebAclRuleStatementArgs[] {
								new() {
									ByteMatchStatement = new WebAclRuleStatementByteMatchStatementArgs {
										FieldToMatch = new WebAclRuleStatementByteMatchStatementFieldToMatchArgs {
											UriPath = new WebAclRuleStatementByteMatchStatementFieldToMatchUriPathArgs()
										},
										PositionalConstraint = "STARTS_WITH",
										SearchString = "/somePath",
										TextTransformations = new WebAclRuleStatementByteMatchStatementTextTransformationArgs {
											Priority = 0,
											Type = "NONE",
										}
									},
								}
							}
						}
					}
				}
			},
		});
bump @acceptable-controller-51383 - any ideas?
m
what are the compile errors @great-france-722