Launch Darkly

v0.0.3 published on Sunday, Sep 18, 2022 by lbrlabs

CustomRole

Provides a LaunchDarkly custom role resource.

This resource allows you to create and manage custom roles within your LaunchDarkly organization.

Note: Custom roles are only available to customers on enterprise plans. To learn more about enterprise plans, contact sales@launchdarkly.com.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Launchdarkly = Lbrlabs.PulumiPackage.Launchdarkly;

return await Deployment.RunAsync(() => 
{
    var example = new Launchdarkly.CustomRole("example", new()
    {
        Description = "This is an example role",
        Key = "example-role-key-1",
        PolicyStatements = new[]
        {
            new Launchdarkly.Inputs.CustomRolePolicyStatementArgs
            {
                Actions = new[]
                {
                    "*",
                },
                Effect = "allow",
                Resources = new[]
                {
                    "proj/*:env/production:flag/*",
                },
            },
            new Launchdarkly.Inputs.CustomRolePolicyStatementArgs
            {
                Actions = new[]
                {
                    "*",
                },
                Effect = "allow",
                Resources = new[]
                {
                    "proj/*:env/production",
                },
            },
        },
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-launchdarkly/sdk/go/launchdarkly"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := launchdarkly.NewCustomRole(ctx, "example", &launchdarkly.CustomRoleArgs{
			Description: pulumi.String("This is an example role"),
			Key:         pulumi.String("example-role-key-1"),
			PolicyStatements: CustomRolePolicyStatementArray{
				&CustomRolePolicyStatementArgs{
					Actions: pulumi.StringArray{
						pulumi.String("*"),
					},
					Effect: pulumi.String("allow"),
					Resources: pulumi.StringArray{
						pulumi.String("proj/*:env/production:flag/*"),
					},
				},
				&CustomRolePolicyStatementArgs{
					Actions: pulumi.StringArray{
						pulumi.String("*"),
					},
					Effect: pulumi.String("allow"),
					Resources: pulumi.StringArray{
						pulumi.String("proj/*:env/production"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.launchdarkly.CustomRole;
import com.pulumi.launchdarkly.CustomRoleArgs;
import com.pulumi.launchdarkly.inputs.CustomRolePolicyStatementArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new CustomRole("example", CustomRoleArgs.builder()        
            .description("This is an example role")
            .key("example-role-key-1")
            .policyStatements(            
                CustomRolePolicyStatementArgs.builder()
                    .actions("*")
                    .effect("allow")
                    .resources("proj/*:env/production:flag/*")
                    .build(),
                CustomRolePolicyStatementArgs.builder()
                    .actions("*")
                    .effect("allow")
                    .resources("proj/*:env/production")
                    .build())
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_launchdarkly as launchdarkly

example = launchdarkly.CustomRole("example",
    description="This is an example role",
    key="example-role-key-1",
    policy_statements=[
        launchdarkly.CustomRolePolicyStatementArgs(
            actions=["*"],
            effect="allow",
            resources=["proj/*:env/production:flag/*"],
        ),
        launchdarkly.CustomRolePolicyStatementArgs(
            actions=["*"],
            effect="allow",
            resources=["proj/*:env/production"],
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as launchdarkly from "@pulumi/launchdarkly";

const example = new launchdarkly.CustomRole("example", {
    description: "This is an example role",
    key: "example-role-key-1",
    policyStatements: [
        {
            actions: ["*"],
            effect: "allow",
            resources: ["proj/*:env/production:flag/*"],
        },
        {
            actions: ["*"],
            effect: "allow",
            resources: ["proj/*:env/production"],
        },
    ],
});
resources:
  example:
    type: launchdarkly:CustomRole
    properties:
      description: This is an example role
      key: example-role-key-1
      policyStatements:
        - actions:
            - '*'
          effect: allow
          resources:
            - proj/*:env/production:flag/*
        - actions:
            - '*'
          effect: allow
          resources:
            - proj/*:env/production

Create a CustomRole Resource

new CustomRole(name: string, args: CustomRoleArgs, opts?: CustomResourceOptions);
@overload
def CustomRole(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               description: Optional[str] = None,
               key: Optional[str] = None,
               name: Optional[str] = None,
               policies: Optional[Sequence[CustomRolePolicyArgs]] = None,
               policy_statements: Optional[Sequence[CustomRolePolicyStatementArgs]] = None)
@overload
def CustomRole(resource_name: str,
               args: CustomRoleArgs,
               opts: Optional[ResourceOptions] = None)
func NewCustomRole(ctx *Context, name string, args CustomRoleArgs, opts ...ResourceOption) (*CustomRole, error)
public CustomRole(string name, CustomRoleArgs args, CustomResourceOptions? opts = null)
public CustomRole(String name, CustomRoleArgs args)
public CustomRole(String name, CustomRoleArgs args, CustomResourceOptions options)
type: launchdarkly:CustomRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CustomRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CustomRoleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CustomRoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CustomRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CustomRoleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CustomRole Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CustomRole resource accepts the following input properties:

Key string

The unique key that references the custom role.

Description string

The description of the custom role.

Name string

The human-readable name for the custom role.

Policies List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.CustomRolePolicyArgs>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

PolicyStatements List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.CustomRolePolicyStatementArgs>

The custom role policy block. To learn more, read Policies in custom roles.

Key string

The unique key that references the custom role.

Description string

The description of the custom role.

Name string

The human-readable name for the custom role.

Policies []CustomRolePolicyArgs

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

PolicyStatements []CustomRolePolicyStatementArgs

The custom role policy block. To learn more, read Policies in custom roles.

key String

The unique key that references the custom role.

description String

The description of the custom role.

name String

The human-readable name for the custom role.

policies List<CustomRolePolicyArgs>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements List<CustomRolePolicyStatementArgs>

The custom role policy block. To learn more, read Policies in custom roles.

key string

The unique key that references the custom role.

description string

The description of the custom role.

name string

The human-readable name for the custom role.

policies CustomRolePolicyArgs[]

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements CustomRolePolicyStatementArgs[]

The custom role policy block. To learn more, read Policies in custom roles.

key str

The unique key that references the custom role.

description str

The description of the custom role.

name str

The human-readable name for the custom role.

policies Sequence[CustomRolePolicyArgs]

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policy_statements Sequence[CustomRolePolicyStatementArgs]

The custom role policy block. To learn more, read Policies in custom roles.

key String

The unique key that references the custom role.

description String

The description of the custom role.

name String

The human-readable name for the custom role.

policies List<Property Map>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements List<Property Map>

The custom role policy block. To learn more, read Policies in custom roles.

Outputs

All input properties are implicitly available as output properties. Additionally, the CustomRole resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing CustomRole Resource

Get an existing CustomRole resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CustomRoleState, opts?: CustomResourceOptions): CustomRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        key: Optional[str] = None,
        name: Optional[str] = None,
        policies: Optional[Sequence[CustomRolePolicyArgs]] = None,
        policy_statements: Optional[Sequence[CustomRolePolicyStatementArgs]] = None) -> CustomRole
func GetCustomRole(ctx *Context, name string, id IDInput, state *CustomRoleState, opts ...ResourceOption) (*CustomRole, error)
public static CustomRole Get(string name, Input<string> id, CustomRoleState? state, CustomResourceOptions? opts = null)
public static CustomRole get(String name, Output<String> id, CustomRoleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string

The description of the custom role.

Key string

The unique key that references the custom role.

Name string

The human-readable name for the custom role.

Policies List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.CustomRolePolicyArgs>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

PolicyStatements List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.CustomRolePolicyStatementArgs>

The custom role policy block. To learn more, read Policies in custom roles.

Description string

The description of the custom role.

Key string

The unique key that references the custom role.

Name string

The human-readable name for the custom role.

Policies []CustomRolePolicyArgs

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

PolicyStatements []CustomRolePolicyStatementArgs

The custom role policy block. To learn more, read Policies in custom roles.

description String

The description of the custom role.

key String

The unique key that references the custom role.

name String

The human-readable name for the custom role.

policies List<CustomRolePolicyArgs>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements List<CustomRolePolicyStatementArgs>

The custom role policy block. To learn more, read Policies in custom roles.

description string

The description of the custom role.

key string

The unique key that references the custom role.

name string

The human-readable name for the custom role.

policies CustomRolePolicyArgs[]

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements CustomRolePolicyStatementArgs[]

The custom role policy block. To learn more, read Policies in custom roles.

description str

The description of the custom role.

key str

The unique key that references the custom role.

name str

The human-readable name for the custom role.

policies Sequence[CustomRolePolicyArgs]

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policy_statements Sequence[CustomRolePolicyStatementArgs]

The custom role policy block. To learn more, read Policies in custom roles.

description String

The description of the custom role.

key String

The unique key that references the custom role.

name String

The human-readable name for the custom role.

policies List<Property Map>

Deprecated:

'policy' is now deprecated. Please migrate to 'policy_statements' to maintain future compatability.

policyStatements List<Property Map>

The custom role policy block. To learn more, read Policies in custom roles.

Supporting Types

CustomRolePolicy

Actions List<string>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

Effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
Resources List<string>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
Actions []string

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

Effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
Resources []string
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
actions List<String>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

effect String
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
resources List<String>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
actions string[]

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
resources string[]
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
actions Sequence[str]

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

effect str
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
resources Sequence[str]
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
actions List<String>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

effect String
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
resources List<String>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.

CustomRolePolicyStatement

Effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
Actions List<string>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

NotActions List<string>

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

NotResources List<string>
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
Resources List<string>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
Effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
Actions []string

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

NotActions []string

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

NotResources []string
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
Resources []string
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
effect String
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
actions List<String>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notActions List<String>

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notResources List<String>
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
resources List<String>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
effect string
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
actions string[]

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notActions string[]

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notResources string[]
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
resources string[]
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
effect str
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
actions Sequence[str]

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

not_actions Sequence[str]

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

not_resources Sequence[str]
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
resources Sequence[str]
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
effect String
  • Either allow or deny. This argument defines whether the statement allows or denies access to the named resources and actions.
actions List<String>

The list of action specifiers defining the actions to which the statement applies. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notActions List<String>

The list of action specifiers defining the actions to which the statement does not apply. Either actions or not_actions must be specified. For a list of available actions read Actions reference.

notResources List<String>
  • The list of resource specifiers defining the resources to which the statement does not apply. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.
resources List<String>
  • The list of resource specifiers defining the resources to which the statement applies. Either resources or not_resources must be specified. For a list of available resources read Understanding resource types and scopes.

Import

You can import LaunchDarkly custom roles by using an existing custom role key. For example

 $ pulumi import launchdarkly:index/customRole:CustomRole example example-role-key-1

Package Details

Repository
https://github.com/lbrlabs/pulumi-launchdarkly
License
Notes

This Pulumi package is based on the launchdarkly Terraform Provider.