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

DXE-4408 Feature request: Allow specifying matchValue as a list for multiple path conditions in CloudLets Policy #591

Open
sejima1105 opened this issue Nov 12, 2024 · 1 comment

Comments

@sejima1105
Copy link

Terraform and Akamai Terraform Provider Versions

Terraform v1.0.10
on darwin_arm64
+ provider registry.terraform.io/akamai/akamai v3.6.0

Affected Resource(s)

  • akamai_cloudlets_policy

Terraform Configuration Files

resource "akamai_cloudlets_policy" "my_policy" {
  name              = "my_policy"
  cloudlet_code     = "ALB"
  description       = "my policy"
  group_id          = "999999"
  match_rule_format = "1.0"
  match_rules = jsonencode(
    [
      {
        forwardSettings = {
          originId = "origin_id"
        }
        matches = [
          {
            caseSensitive = false
            matchOperator = "contains"
            matchType     = "path"
            matchValue    = "/path1-1/* /path1-2/* /path1-3/* /path1-4/* /path1-5/* /path1-6/* /path1-7/* /path1-8/* /path1-9/* /path1-10/*"
            negate        = false
          },
        ]
        matchesAlways = false
        name          = "rule1"
        type          = "albMatchRule"
      },
      {
        forwardSettings = {
          originId = "origin_id"
        }
        matches = [
          {
            caseSensitive = false
            matchOperator = "contains"
            matchType     = "path"
            matchValue    = "/path2-1/* /path2-2/* /path2-3/* /path2-4/* /path2-5/* /path2-6/* /path2-7/* /path2-8/* /path2-9/* /path2-10/*"
            negate        = false
          },
        ]
        matchesAlways = false
        name          = "rule2"
        type          = "albMatchRule"
      }
    ]
  )
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

For example, I would like to express the matchValue as a list type (i.e., matchValues), as shown below.
I believe that using a list type would help prevent configuration errors and improve visibility.

resource "akamai_cloudlets_policy" "my_policy" {
  name              = "my_policy"
  cloudlet_code     = "ALB"
  description       = "my policy"
  group_id          = "999999"
  match_rule_format = "1.0"
  match_rules = jsonencode(
    [
      {
        forwardSettings = {
          originId = "origin_id"
        }
        matches = [
          {
            caseSensitive = false
            matchOperator = "contains"
            matchType     = "path"
            matchValues    = [
                "/path1-1/*",
                "/path1-2/*",
                "/path1-3/*",
                "/path1-4/*",
                "/path1-5/*",
                "/path1-6/*",
                "/path1-7/*",
                "/path1-8/*",
                "/path1-9/*",
                "/path1-10/*"
            ]
            negate        = false
          },
        ]
        matchesAlways = false
        name          = "rule1"
        type          = "albMatchRule"
      },
      {
        forwardSettings = {
          originId = "origin_id"
        }
        matches = [
          {
            caseSensitive = false
            matchOperator = "contains"
            matchType     = "path"
            matchValues    = [
                "/path2-1/*",
                "/path2-2/*",
                "/path2-3/*",
                "/path2-4/*",
                "/path2-5/*",
                "/path2-6/*",
                "/path2-7/*",
                "/path2-8/*",
                "/path2-9/*",
                "/path2-10/*"
            ]
            negate        = false
          },
        ]
        matchesAlways = false
        name          = "rule2"
        type          = "albMatchRule"
      }
    ]
  )
}

Actual Behavior

Only a string type (matchValue) can be specified, not a list type.

Steps to Reproduce

N/A

Important Factoids

N/A

References

N/A

@KonradRajda KonradRajda changed the title Feature request: Allow specifying matchValue as a list for multiple path conditions in CloudLets Policy DXE-4408 Feature request: Allow specifying matchValue as a list for multiple path conditions in CloudLets Policy Nov 13, 2024
@KonradRajda
Copy link

Hi @sejima1105,

Thanks for this suggestion, we will think it over and go back to you.
Best regards,
Konrad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants