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

Error when trying to import aws.wafv2.WebAcl #2854

Closed
sandervb2 opened this issue Oct 5, 2023 · 6 comments
Closed

Error when trying to import aws.wafv2.WebAcl #2854

sandervb2 opened this issue Oct 5, 2023 · 6 comments
Assignees
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/no-repro This issue wasn't able to be reproduced service/wafv2 Issues with aws.wafv2 resources
Milestone

Comments

@sandervb2
Copy link

sandervb2 commented Oct 5, 2023

What happened?

Normally after successfully importing a resource i get the python code to add to my program but when I tried to import a aws.wafv2.WebAcl resource, I got the following error:

({
  name: string,
  priority: 1,
  statement: { ipSetReferenceStatement: { arn: string } },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 2,
  statement: {
    ipSetReferenceStatement: {
      arn: string,
      ipSetForwardedIpConfig: {
        fallbackBehavior: string,
        headerName: string,
        position: string,
      },
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 13,
  statement: {
    sizeConstraintStatement: {
      comparisonOperator: string,
      fieldToMatch: 
        { body: { oversizeHandling: string } },
      size: 16384,
      textTransformations: (
        { priority: 0, type: string }
      ),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 14,
  statement: {
    sizeConstraintStatement: {
      comparisonOperator: string,
      fieldToMatch: {
        jsonBody: {
          matchPattern: {},
          matchScope: string,
          oversizeHandling: 
            string,
        },
      },
      size: 16384,
      textTransformations: (
        { priority: 0, type: string }
      ),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 900,
  statement: {
    orStatement: {
      statements: ({
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          fieldToMatch: {
            singleHeader: 
              {
                name: 
                  string,
              }
          },
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      }),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 800,
  statement: { geoMatchStatement: { countryCodes: (string, string, string, string, string) } },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 801,
  statement: {
    geoMatchStatement: {
      countryCodes: (string, string, string, string, string),
      forwardedIpConfig: {
        fallbackBehavior: string,
        headerName: string,
      },
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 101,
  statement: { ipSetReferenceStatement: { arn: string } },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 102,
  statement: {
    ipSetReferenceStatement: {
      arn: string,
      ipSetForwardedIpConfig: {
        fallbackBehavior: string,
        headerName: string,
        position: string,
      },
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 200,
  statement: {
    andStatement: {
      statements: ({
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      }),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 11,
  statement: {
    sizeConstraintStatement: {
      comparisonOperator: string,
      fieldToMatch: {
        cookies: {
          matchPatterns: ({}),
          matchScope: string,
          oversizeHandling: 
            string,
        },
      },
      size: 8192,
      textTransformations: (
        { priority: 0, type: string }
      ),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 12,
  statement: {
    sizeConstraintStatement: {
      comparisonOperator: string,
      fieldToMatch: {
        headers: ({
          matchPattern: {},
          matchScope: string,
          oversizeHandling: 
            string,
        }),
      },
      size: 8192,
      textTransformations: (
        { priority: 0, type: string }
      ),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 700,
  statement: {
    orStatement: {
      statements: ({
        byteMatchStatement: {
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      },
      {
        byteMatchStatement: {
          positionalConstraint: 
            string,
          searchString: string,
          textTransformations: (
            {
              priority: 
                0,
              type: 
                string,
            }
          ),
        },
      }),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 300,
  statement: {
    andStatement: {
      statements: ({
        orStatement: {
          statements: ({
            sqliMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    body: 
                      {
                        oversizeHandling: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    body: 
                      {
                        oversizeHandling: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            sqliMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      }),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
},
{
  name: string,
  priority: 600,
  statement: {
    andStatement: {
      statements: ({
        orStatement: {
          statements: ({
            xssMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                fieldToMatch: 
                  {
                    body: 
                      {
                        oversizeHandling: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                fieldToMatch: 
                  {
                    body: 
                      {
                        oversizeHandling: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          },
          {
            xssMatchStatement: 
              {
                fieldToMatch: 
                  {
                    singleHeader: 
                      {
                        name: 
                          string,
                      }
                  }
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      },
      {
        notStatement: {
          statements: ({
            byteMatchStatement: 
              {
                positionalConstraint: 
                  string,
                searchString: 
                  string,
                textTransformations: 
                  ({
                    priority: 
                      0,
                    type: 
                      string,
                  })
              }
          }),
        },
      }),
    },
  },
  visibilityConfig: {
    cloudwatchMetricsEnabled: true,
    metricName: string,
    sampledRequestsEnabled: true,
  },
}) to location of type   list(  {
      action:   {
          allow:   {
              customRequestHandling:   {
                  insertHeaders:   list(  {
                        name: 
                            output(
                              string
                            )
                          | string
                        value: 
                            output(
                              string
                            )
                          | string
                      }
                    | output(
                        {
                          name: 
                            string,
                          value: 
                            string,
                        }
                      ))
                  | output(list(
                      {
                        name: 
                          string,
                        value: 
                          string,
                      }
                    )),
                }
              | output({
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                })?,
            }
          | output({
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            })?,
          block:   {
              customResponse:   {
                  customResponseBodyKey:   output(
                      string
                    )
                  | string?,
                  responseCode: int | output(int),
                  responseHeaders:   list(  {
                        name: 
                            output(
                              string
                            )
                          | string
                        value: 
                            output(
                              string
                            )
                          | string
                      }
                    | output({
                        name: 
                          string,
                        value: 
                          string,
                      }))
                  | output(list({
                      name: 
                        string,
                      value: 
                        string,
                    }))?,
                }
              | output({
                  customResponseBodyKey: 
                    string?,
                  responseCode: int,
                  responseHeaders:   list({
                      name: 
                        string,
                      value: 
                        string,
                    })?,
                })?,
            }
          | output({
              customResponse:   {
                  customResponseBodyKey: 
                    string?,
                  responseCode: int,
                  responseHeaders:   list({
                      name: 
                        string,
                      value: 
                        string,
                    })?,
                }?,
            })?,
          captcha:   {
              customRequestHandling:   {
                  insertHeaders:   list(  {
                        name: 
                            output(
                              string
                            )
                          | string
                        value: 
                            output(
                              string
                            )
                          | string
                      }
                    | output(
                        {
                          name: 
                            string,
                          value: 
                            string,
                        }
                      ))
                  | output(
                      list({
                        name: 
                          string,
                        value: 
                          string,
                      })
                    ),
                }
              | output({
                  insertHeaders: list(
                    {
                      name: 
                        string,
                      value: 
                        string,
                    }
                  ),
                })?,
            }
          | output({
              customRequestHandling:   {
                  insertHeaders: list(
                    {
                      name: 
                        string,
                      value: 
                        string,
                    }
                  ),
                }?,
            })?,
          challenge:   {
              customRequestHandling:   {
                  insertHeaders:   list(  {
                        name: 
                            output(
                              string
                            )
                          | string
                        value: 
                            output(
                              string
                            )
                          | string
                      }
                    | output(
                        {
                          name: 
                            string,
                          value: 
                            string,
                        }
                      ))
                  | output(
                      list({
                        name: 
                          string,
                        value: 
                          string,
                      })
                    ),
                }
              | output({
                  insertHeaders: 
                    list({
                      name: 
                        string,
                      value: 
                        string,
                    })
                })?,
            }
          | output({
              customRequestHandling:   {
                  insertHeaders: 
                    list({
                      name: 
                        string,
                      value: 
                        string,
                    })
                }?,
            })?,
          count:   {
              customRequestHandling:   {
                  insertHeaders:   list(  {
                        name: 
                            output(
                              string
                            )
                          | string
                        value: 
                            output(
                              string
                            )
                          | string
                      }
                    | output(
                        {
                          name: 
                            string,
                          value: 
                            string,
                        }
                      ))
                  | output(list(
                      {
                        name: 
                          string,
                        value: 
                          string,
                      }
                    )),
                }
              | output({
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                })?,
            }
          | output({
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            })?,
        }
      | output({
          allow:   {
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            }?,
          block:   {
              customResponse:   {
                  customResponseBodyKey: 
                    string?,
                  responseCode: int,
                  responseHeaders:   list({
                      name: 
                        string,
                      value: 
                        string,
                    })?,
                }?,
            }?,
          captcha:   {
              customRequestHandling:   {
                  insertHeaders: list(
                    {
                      name: 
                        string,
                      value: 
                        string,
                    }
                  ),
                }?,
            }?,
          challenge:   {
              customRequestHandling:   {
                  insertHeaders: 
                    list({
                      name: 
                        string,
                      value: 
                        string,
                    })
                }?,
            }?,
          count:   {
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            }?,
        })?,
      captchaConfig:   {
          immunityTimeProperty:   { immunityTime: int | output(int)? }
          | output({ immunityTime: int? })?,
        }
      | output({ immunityTimeProperty: { immunityTime: int? }? })?,
      name: output(string) | string,
      overrideAction:   { count: {} | output({})?, none: {} | output({})? }
      | output({ count: {}?, none: {}? })?,
      priority: int | output(int),
      ruleLabels:   list({ name: output(string) | string } | output({ name: string }))
      | output(list({ name: string }))?,
      statement: 'T1 | output('T2),
      visibilityConfig:   {
          cloudwatchMetricsEnabled: bool | output(bool),
          metricName: output(string) | string,
          sampledRequestsEnabled: bool | output(bool),
        }
      | output({
          cloudwatchMetricsEnabled: bool,
          metricName: string,
          sampledRequestsEnabled: bool,
        }),
    }
  | output({
      action:   {
          allow:   {
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            }?,
          block:   {
              customResponse:   {
                  customResponseBodyKey: 
                    string?,
                  responseCode: int,
                  responseHeaders:   list({
                      name: 
                        string,
                      value: 
                        string,
                    })?,
                }?,
            }?,
          captcha:   {
              customRequestHandling:   {
                  insertHeaders: list(
                    {
                      name: 
                        string,
                      value: 
                        string,
                    }
                  ),
                }?,
            }?,
          challenge:   {
              customRequestHandling:   {
                  insertHeaders: 
                    list({
                      name: 
                        string,
                      value: 
                        string,
                    })
                }?,
            }?,
          count:   {
              customRequestHandling:   {
                  insertHeaders: list({
                    name: 
                      string,
                    value: 
                      string,
                  }),
                }?,
            }?,
        }?,
      captchaConfig: { immunityTimeProperty: { immunityTime: int? }? }?,
      name: string,
      overrideAction: { count: {}?, none: {}? }?,
      priority: int,
      ruleLabels: list({ name: string })?,
      statement: 'T2,
      visibilityConfig: {
        cloudwatchMetricsEnabled: bool,
        metricName: string,
        sampledRequestsEnabled: bool,
      },
    }))
| output(list({
    action:   {
        allow:   {
            customRequestHandling:   {
                insertHeaders: list({
                  name: 
                    string,
                  value: 
                    string,
                }),
              }?,
          }?,
        block:   {
            customResponse:   {
                customResponseBodyKey: string?,
                responseCode: int,
                responseHeaders:   list({
                    name: 
                      string,
                    value: 
                      string,
                  })?,
              }?,
          }?,
        captcha:   {
            customRequestHandling:   {
                insertHeaders: list({
                  name: 
                    string,
                  value: 
                    string,
                }),
              }?,
          }?,
        challenge:   {
            customRequestHandling:   {
                insertHeaders: list(
                  {
                    name: 
                      string,
                    value: 
                      string,
                  }
                ),
              }?,
          }?,
        count:   {
            customRequestHandling:   {
                insertHeaders: list({
                  name: 
                    string,
                  value: 
                    string,
                }),
              }?,
          }?,
      }?,
    captchaConfig: { immunityTimeProperty: { immunityTime: int? }? }?,
    name: string,
    overrideAction: { count: {}?, none: {}? }?,
    priority: int,
    ruleLabels: list({ name: string })?,
    statement: 'T2,
    visibilityConfig: {
      cloudwatchMetricsEnabled: bool,
      metricName: string,
      sampledRequestsEnabled: bool,
    },
  }))?: ; 

Example

I used the following command to import the WebAcl resource:

 pulumi import aws:wafv2/webAcl:WebAcl <resource_name> <webacl-id>/<webacl-name>/REGIONAL

Output of pulumi about

Backend        
Name           <my-backend-name>
URL            <my-s3-backed-url>
User           <my-user>
Organizations  
Token type     personal

Dependencies:
NAME        VERSION
boto3       1.28.53
fabric      3.2.2
pip         22.3.1
psutil      5.9.5
pulumi-aws  6.4.0
requests    2.31.0
setuptools  65.5.1
wheel       0.38.4

Pulumi locates its logs in /tmp by default

Additional context

I noticed that the import function in the api docs for the wafv2.WebAcl is not there (anymore?) After selecting yes at the prompt to confirm the WebAcl import, I received the following warnings:

Do you want to perform this import? yes
Importing (<stack_name>):
     Type                 Name                    Status               Info
     pulumi:pulumi:Stack  <stack_name>                       
 =   └─ aws:wafv2:WebAcl  <resource_name>  imported (0.08s)     5 warnings


Diagnostics:
  aws:wafv2:WebAcl (<resource_name>):
    warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
    warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.13.statement.0.and_statement.0.statement.0.or_statement.0.statement.4.sqli_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.
    warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.13.statement.0.and_statement.0.statement.0.or_statement.0.statement.5.sqli_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.
    warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.14.statement.0.and_statement.0.statement.0.or_statement.0.statement.4.xss_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.
    warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.14.statement.0.and_statement.0.statement.0.or_statement.0.statement.5.xss_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.

Resources:
    = 1 imported
    752 unchanged

Duration: 4s

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).

@sandervb2 sandervb2 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 5, 2023
@mikhailshilkov
Copy link
Member

@Frassle Can you help me read this message? Why have we printed this diagnostics?

@Frassle
Copy link
Member

Frassle commented Oct 6, 2023

The first message is from codegen, that it can't assign an expression of one shape to a location of another (there's a "to location of type" hidden in the middle of that long message).

Now that's probably a Read bug, because I'd expect the shape of date returned from Read to match the schema shape. But it's probably an import/codegen bug as well because we should be tolerant to bad Read implementations. I think we could warn that the types don't match but we should still try and write out the best guess of the code.

The warnings after:

 warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
    warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.13.statement.0.and_statement.0.statement.0.or_statement.0.statement.4.sqli_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.
...

Are that after we got the data from Read we passed it back to Check, and Check reported those failures. This is just a provider bug, either in Read or Check (or both).

@mikhailshilkov mikhailshilkov added area/import An issue related to `pulumi import` or the import resource option. and removed needs-triage Needs attention from the triage team labels Oct 6, 2023
@t0yv0
Copy link
Member

t0yv0 commented Apr 22, 2024

It's difficult to read such a long type printout, but it could be that it's failing to match null against the expected type as in #2534 - if the root-cause is the same, that'd be an error because in TF null may populate every type; even when bridged providers emit required signatures for output properties to emit SDKs that are not projecting as Optional to the runtime, these may and will be populated by null in certain situations.

The other ticket that may be relevant here is pulumi/pulumi-terraform-bridge#1225 where we're not running validators in the same order as TF would.

@t0yv0
Copy link
Member

t0yv0 commented Apr 22, 2024

It would be a great help if we had a quick repro here I could try some possible fixes on, much appreciated.

@t0yv0 t0yv0 added the needs-repro Needs repro steps before it can be triaged or fixed label Apr 22, 2024
This was referenced Apr 22, 2024
@t0yv0 t0yv0 added the service/wafv2 Issues with aws.wafv2 resources label May 3, 2024
@corymhall
Copy link
Contributor

  const wafACL = new aws.wafv2.WebAcl('waf', {
    name: 'waf;,
    scope: 'REGIONAL',
    defaultAction: {
      allow: {},
    },
    visibilityConfig: {
      cloudwatchMetricsEnabled: true,
      metricName: 'waf-acl',
      sampledRequestsEnabled: true,
    },
    rules: [
      {
        name: 'AWS-AWSManagedRulesAdminProtectionRuleSet',
        priority: 3,
        overrideAction: {
          none: {},
        },
        statement: {
          managedRuleGroupStatement: {
            name: 'AWSManagedRulesAdminProtectionRuleSet',
            vendorName: 'AWS',
          },
        },
        visibilityConfig: {
          cloudwatchMetricsEnabled: true,
          metricName: 'AWSManagedRulesAdminProtectionRuleSet',
          sampledRequestsEnabled: true,
        },
      },
    ],
    tags: {
      Name: 'waf',
    },
  });
  export const id =  pulumi.interpolate`${wafACL.id}/${wafACL.name}/${wafACL.scope}`;

I'm using the above program to try and reproduce the issue, but I am able to import and generate a program successfully. I've tried generating in both python and typescript.

  1. pulumi up with the program
  2. take the id output and run pulumi import aws:wafv2/webAcl:WebAcl res $ID_HERE

@corymhall corymhall added the resolution/no-repro This issue wasn't able to be reproduced label Jul 22, 2024
@corymhall
Copy link
Contributor

@sandervb2 I'm going to go ahead and close this since it's been open for over 1 year and we still don't have a program that can reproduce the issue. If you are still seeing the issue and can provide a reproduction let us know and we can reopen this.

@corymhall corymhall self-assigned this Jul 22, 2024
@mjeffryes mjeffryes added this to the 0.108 milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed resolution/no-repro This issue wasn't able to be reproduced service/wafv2 Issues with aws.wafv2 resources
Projects
None yet
Development

No branches or pull requests

6 participants