1. Packages
  2. Consul Provider
  3. API Docs
  4. NamespaceRoleAttachment
Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi

consul.NamespaceRoleAttachment

Explore with Pulumi AI

Import

consul_namespace_role_attachment can be imported. This is especially useful to manage the policies attached to the default namespace:

$ pulumi import consul:index/namespaceRoleAttachment:NamespaceRoleAttachment default default:role_name
Copy

Create NamespaceRoleAttachment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NamespaceRoleAttachment(name: string, args: NamespaceRoleAttachmentArgs, opts?: CustomResourceOptions);
@overload
def NamespaceRoleAttachment(resource_name: str,
                            args: NamespaceRoleAttachmentArgs,
                            opts: Optional[ResourceOptions] = None)

@overload
def NamespaceRoleAttachment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            namespace: Optional[str] = None,
                            role: Optional[str] = None)
func NewNamespaceRoleAttachment(ctx *Context, name string, args NamespaceRoleAttachmentArgs, opts ...ResourceOption) (*NamespaceRoleAttachment, error)
public NamespaceRoleAttachment(string name, NamespaceRoleAttachmentArgs args, CustomResourceOptions? opts = null)
public NamespaceRoleAttachment(String name, NamespaceRoleAttachmentArgs args)
public NamespaceRoleAttachment(String name, NamespaceRoleAttachmentArgs args, CustomResourceOptions options)
type: consul:NamespaceRoleAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var namespaceRoleAttachmentResource = new Consul.NamespaceRoleAttachment("namespaceRoleAttachmentResource", new()
{
    Namespace = "string",
    Role = "string",
});
Copy
example, err := consul.NewNamespaceRoleAttachment(ctx, "namespaceRoleAttachmentResource", &consul.NamespaceRoleAttachmentArgs{
	Namespace: pulumi.String("string"),
	Role:      pulumi.String("string"),
})
Copy
var namespaceRoleAttachmentResource = new NamespaceRoleAttachment("namespaceRoleAttachmentResource", NamespaceRoleAttachmentArgs.builder()
    .namespace("string")
    .role("string")
    .build());
Copy
namespace_role_attachment_resource = consul.NamespaceRoleAttachment("namespaceRoleAttachmentResource",
    namespace="string",
    role="string")
Copy
const namespaceRoleAttachmentResource = new consul.NamespaceRoleAttachment("namespaceRoleAttachmentResource", {
    namespace: "string",
    role: "string",
});
Copy
type: consul:NamespaceRoleAttachment
properties:
    namespace: string
    role: string
Copy

NamespaceRoleAttachment Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NamespaceRoleAttachment resource accepts the following input properties:

Namespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace to attach the role to.
Role
This property is required.
Changes to this property will trigger replacement.
string
The name of the role attached to the namespace.
Namespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace to attach the role to.
Role
This property is required.
Changes to this property will trigger replacement.
string
The name of the role attached to the namespace.
namespace
This property is required.
Changes to this property will trigger replacement.
String
The namespace to attach the role to.
role
This property is required.
Changes to this property will trigger replacement.
String
The name of the role attached to the namespace.
namespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace to attach the role to.
role
This property is required.
Changes to this property will trigger replacement.
string
The name of the role attached to the namespace.
namespace
This property is required.
Changes to this property will trigger replacement.
str
The namespace to attach the role to.
role
This property is required.
Changes to this property will trigger replacement.
str
The name of the role attached to the namespace.
namespace
This property is required.
Changes to this property will trigger replacement.
String
The namespace to attach the role to.
role
This property is required.
Changes to this property will trigger replacement.
String
The name of the role attached to the namespace.

Outputs

All input properties are implicitly available as output properties. Additionally, the NamespaceRoleAttachment 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 Existing NamespaceRoleAttachment Resource

Get an existing NamespaceRoleAttachment 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?: NamespaceRoleAttachmentState, opts?: CustomResourceOptions): NamespaceRoleAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        namespace: Optional[str] = None,
        role: Optional[str] = None) -> NamespaceRoleAttachment
func GetNamespaceRoleAttachment(ctx *Context, name string, id IDInput, state *NamespaceRoleAttachmentState, opts ...ResourceOption) (*NamespaceRoleAttachment, error)
public static NamespaceRoleAttachment Get(string name, Input<string> id, NamespaceRoleAttachmentState? state, CustomResourceOptions? opts = null)
public static NamespaceRoleAttachment get(String name, Output<String> id, NamespaceRoleAttachmentState state, CustomResourceOptions options)
resources:  _:    type: consul:NamespaceRoleAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Namespace Changes to this property will trigger replacement. string
The namespace to attach the role to.
Role Changes to this property will trigger replacement. string
The name of the role attached to the namespace.
Namespace Changes to this property will trigger replacement. string
The namespace to attach the role to.
Role Changes to this property will trigger replacement. string
The name of the role attached to the namespace.
namespace Changes to this property will trigger replacement. String
The namespace to attach the role to.
role Changes to this property will trigger replacement. String
The name of the role attached to the namespace.
namespace Changes to this property will trigger replacement. string
The namespace to attach the role to.
role Changes to this property will trigger replacement. string
The name of the role attached to the namespace.
namespace Changes to this property will trigger replacement. str
The namespace to attach the role to.
role Changes to this property will trigger replacement. str
The name of the role attached to the namespace.
namespace Changes to this property will trigger replacement. String
The namespace to attach the role to.
role Changes to this property will trigger replacement. String
The name of the role attached to the namespace.

Package Details

Repository
HashiCorp Consul pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.