Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support JSON Object for Policy Statements in launchdarkly_custom_role Resource #217

Copy link
Copy link
@yonivoi96

Description

@yonivoi96
Issue body actions

I would like to request a feature enhancement for the launchdarkly_custom_role resource in the LaunchDarkly Terraform provider. Currently, the policy statements must be defined using multiple policy_statements nested blocks.
The current approach makes it hard to manage complex roles with numerous policies.
The suggested behavior can help with it and in addition it will enable to use Terraform's powerful templating features.

Current behavior:

resource "launchdarkly_custom_role" "example" {
  key         = "example-role-key-1"
  name        = "example role"
  description = "This is an example role"

  policy_statements {
    effect    = "allow"
    resources = ["proj/*:env/production:flag/*"]
    actions   = ["*"]
  }
  policy_statements {
    effect    = "allow"
    resources = ["proj/*:env/production"]
    actions   = ["*"]
  }
}

Desired behavior:

[
  {
    "effect": "allow",
    "resources": ["proj/*:env/production:flag/*"],
    "actions": ["*"]
  },
  {
    "effect": "allow",
    "resources": ["proj/*:env/production"],
    "actions": ["*"]
  }
]
resource "launchdarkly_custom_role" "example" {
  key         = "example-role-key-1"
  name        = "example role"
  description = "This is an example role"

  policy = jsonencode(file("${path.module}/policy_statements.json"))
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.