Class AuthBackendRole
Manages an AWS auth backend role in a Vault server. Roles constrain the instances or principals that can perform the login operation against the backend. See the Vault documentation for more information.
Example Usage
using Pulumi;
using Vault = Pulumi.Vault;
class MyStack : Stack
{
public MyStack()
{
var aws = new Vault.AuthBackend("aws", new Vault.AuthBackendArgs
{
Type = "aws",
});
var example = new Vault.Aws.AuthBackendRole("example", new Vault.Aws.AuthBackendRoleArgs
{
Backend = aws.Path,
Role = "test-role",
AuthType = "iam",
BoundAmiIds =
{
"ami-8c1be5f6",
},
BoundAccountIds =
{
"123456789012",
},
BoundVpcIds =
{
"vpc-b61106d4",
},
BoundSubnetIds =
{
"vpc-133128f1",
},
BoundIamRoleArns =
{
"arn:aws:iam::123456789012:role/MyRole",
},
BoundIamInstanceProfileArns =
{
"arn:aws:iam::123456789012:instance-profile/MyProfile",
},
InferredEntityType = "ec2_instance",
InferredAwsRegion = "us-east-1",
TokenTtl = 60,
TokenMaxTtl = 120,
TokenPolicies =
{
"default",
"dev",
"prod",
},
});
}
}
Inherited Members
Namespace: Pulumi.Vault.Aws
Assembly: Pulumi.Vault.dll
Syntax
public class AuthBackendRole : CustomResource
Constructors
View SourceAuthBackendRole(String, AuthBackendRoleArgs, CustomResourceOptions)
Create a AuthBackendRole resource with the given unique name, arguments, and options.
Declaration
public AuthBackendRole(string name, AuthBackendRoleArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| AuthBackendRoleArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAllowInstanceMigration
If set to true, allows migration of
the underlying instance where the client resides.
Declaration
public Output<bool?> AllowInstanceMigration { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
AuthType
The auth type permitted for this role. Valid choices
are ec2 and iam. Defaults to iam.
Declaration
public Output<string> AuthType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Backend
Unique name of the auth backend to configure.
Declaration
public Output<string> Backend { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
BoundAccountIds
If set, defines a constraint on the EC2
instances that can perform the login operation that they should be using the
account ID specified by this field. auth_type must be set to ec2 or
inferred_entity_type must be set to ec2_instance to use this constraint.
Declaration
public Output<ImmutableArray<string>> BoundAccountIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundAmiIds
If set, defines a constraint on the EC2 instances
that can perform the login operation that they should be using the AMI ID
specified by this field. auth_type must be set to ec2 or
inferred_entity_type must be set to ec2_instance to use this constraint.
Declaration
public Output<ImmutableArray<string>> BoundAmiIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundEc2InstanceIds
Only EC2 instances that match this instance ID will be permitted to log in.
Declaration
public Output<ImmutableArray<string>> BoundEc2InstanceIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundIamInstanceProfileArns
If set, defines a constraint on
the EC2 instances that can perform the login operation that they must be
associated with an IAM instance profile ARN which has a prefix that matches
the value specified by this field. The value is prefix-matched as though it
were a glob ending in *. auth_type must be set to ec2 or
inferred_entity_type must be set to ec2_instance to use this constraint.
Declaration
public Output<ImmutableArray<string>> BoundIamInstanceProfileArns { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundIamPrincipalArns
If set, defines the IAM principal that
must be authenticated when auth_type is set to iam. Wildcards are
supported at the end of the ARN.
Declaration
public Output<ImmutableArray<string>> BoundIamPrincipalArns { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundIamRoleArns
If set, defines a constraint on the EC2
instances that can perform the login operation that they must match the IAM
role ARN specified by this field. auth_type must be set to ec2 or
inferred_entity_type must be set to ec2_instance to use this constraint.
Declaration
public Output<ImmutableArray<string>> BoundIamRoleArns { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundRegions
If set, defines a constraint on the EC2 instances
that can perform the login operation that the region in their identity
document must match the one specified by this field. auth_type must be set
to ec2 or inferred_entity_type must be set to ec2_instance to use this
constraint.
Declaration
public Output<ImmutableArray<string>> BoundRegions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundSubnetIds
If set, defines a constraint on the EC2
instances that can perform the login operation that they be associated with
the subnet ID that matches the value specified by this field. auth_type
must be set to ec2 or inferred_entity_type must be set to ec2_instance
to use this constraint.
Declaration
public Output<ImmutableArray<string>> BoundSubnetIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BoundVpcIds
If set, defines a constraint on the EC2 instances
that can perform the login operation that they be associated with the VPC ID
that matches the value specified by this field. auth_type must be set to
ec2 or inferred_entity_type must be set to ec2_instance to use this
constraint.
Declaration
public Output<ImmutableArray<string>> BoundVpcIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
DisallowReauthentication
IF set to true, only allows a
single token to be granted per instance ID. This can only be set when
auth_type is set to ec2.
Declaration
public Output<bool?> DisallowReauthentication { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
InferredAwsRegion
When inferred_entity_type is set, this
is the region to search for the inferred entities. Required if
inferred_entity_type is set. This only applies when auth_type is set to
iam.
Declaration
public Output<string> InferredAwsRegion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InferredEntityType
If set, instructs Vault to turn on
inferencing. The only valid value is ec2_instance, which instructs Vault to
infer that the role comes from an EC2 instance in an IAM instance profile.
This only applies when auth_type is set to iam.
Declaration
public Output<string> InferredEntityType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaxTtl
The maximum allowed lifetime of tokens issued using this role, provided as a number of seconds.
Declaration
public Output<int?> MaxTtl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Period
If set, indicates that the token generated using this role should never expire. The token should be renewed within the duration specified by this value. At each renewal, the token's TTL will be set to the value of this field. Specified in seconds.
Declaration
public Output<int?> Period { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Policies
An array of strings specifying the policies to be set on tokens issued using this role.
Declaration
public Output<ImmutableArray<string>> Policies { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ResolveAwsUniqueIds
If set to true, the
bound_iam_principal_arns are resolved to AWS Unique
IDs
for the bound principal ARN. This field is ignored when a
bound_iam_principal_arn ends in a wildcard. Resolving to unique IDs more
closely mimics the behavior of AWS services in that if an IAM user or role is
deleted and a new one is recreated with the same name, those new users or
roles won't get access to roles in Vault that were permissioned to the prior
principals of the same name. Defaults to true.
Once set to true, this cannot be changed to false without recreating the role.
Declaration
public Output<bool?> ResolveAwsUniqueIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Role
The name of the role.
Declaration
public Output<string> Role { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RoleTag
If set, enable role tags for this role. The value set
for this field should be the key of the tag on the EC2 instance. auth_type
must be set to ec2 or inferred_entity_type must be set to ec2_instance
to use this constraint.
Declaration
public Output<string> RoleTag { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TokenBoundCidrs
List of CIDR blocks; if set, specifies blocks of IP addresses which can authenticate successfully, and ties the resulting token to these blocks as well.
Declaration
public Output<ImmutableArray<string>> TokenBoundCidrs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TokenExplicitMaxTtl
If set, will encode an
explicit max TTL
onto the token in number of seconds. This is a hard cap even if token_ttl and
token_max_ttl would otherwise allow a renewal.
Declaration
public Output<int?> TokenExplicitMaxTtl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
TokenMaxTtl
The maximum lifetime for generated tokens in number of seconds. Its current value will be referenced at renewal time.
Declaration
public Output<int?> TokenMaxTtl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
TokenNoDefaultPolicy
If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies set in token_policies.
Declaration
public Output<bool?> TokenNoDefaultPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
TokenNumUses
The period, if any, in number of seconds to set on the token.
Declaration
public Output<int?> TokenNumUses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
TokenPeriod
If set, indicates that the token generated using this role should never expire. The token should be renewed within the duration specified by this value. At each renewal, the token's TTL will be set to the value of this field. Specified in seconds.
Declaration
public Output<int?> TokenPeriod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
TokenPolicies
List of policies to encode onto generated tokens. Depending on the auth method, this list may be supplemented by user/group/other values.
Declaration
public Output<ImmutableArray<string>> TokenPolicies { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TokenTtl
The incremental lifetime for generated tokens in number of seconds. Its current value will be referenced at renewal time.
Declaration
public Output<int?> TokenTtl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
TokenType
The type of token that should be generated. Can be service,
batch, or default to use the mount's tuned default (which unless changed will be
service tokens). For token store roles, there are two additional possibilities:
default-service and default-batch which specify the type to return unless the client
requests a different type at generation time.
Declaration
public Output<string> TokenType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ttl
The TTL period of tokens issued using this role, provided as a number of seconds.
Declaration
public Output<int?> Ttl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Methods
View SourceGet(String, Input<String>, AuthBackendRoleState, CustomResourceOptions)
Get an existing AuthBackendRole resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static AuthBackendRole Get(string name, Input<string> id, AuthBackendRoleState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| AuthBackendRoleState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| AuthBackendRole |