Auth Backend Role Args
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](https://www.vaultproject.io/docs/auth/aws.html) for more information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const aws = new vault.AuthBackend("aws", {type: "aws"});
const example = new vault.aws.AuthBackendRole("example", {
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",
],
});
import pulumi
import pulumi_vault as vault
aws = vault.AuthBackend("aws", type="aws")
example = vault.aws.AuthBackendRole("example",
backend=aws.path,
role="test-role",
auth_type="iam",
bound_ami_ids=["ami-8c1be5f6"],
bound_account_ids=["123456789012"],
bound_vpc_ids=["vpc-b61106d4"],
bound_subnet_ids=["vpc-133128f1"],
bound_iam_role_arns=["arn:aws:iam::123456789012:role/MyRole"],
bound_iam_instance_profile_arns=["arn:aws:iam::123456789012:instance-profile/MyProfile"],
inferred_entity_type="ec2_instance",
inferred_aws_region="us-east-1",
token_ttl=60,
token_max_ttl=120,
token_policies=[
"default",
"dev",
"prod",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var aws = new Vault.AuthBackend("aws", new()
{
Type = "aws",
});
var example = new Vault.Aws.AuthBackendRole("example", new()
{
Backend = aws.Path,
Role = "test-role",
AuthType = "iam",
BoundAmiIds = new[]
{
"ami-8c1be5f6",
},
BoundAccountIds = new[]
{
"123456789012",
},
BoundVpcIds = new[]
{
"vpc-b61106d4",
},
BoundSubnetIds = new[]
{
"vpc-133128f1",
},
BoundIamRoleArns = new[]
{
"arn:aws:iam::123456789012:role/MyRole",
},
BoundIamInstanceProfileArns = new[]
{
"arn:aws:iam::123456789012:instance-profile/MyProfile",
},
InferredEntityType = "ec2_instance",
InferredAwsRegion = "us-east-1",
TokenTtl = 60,
TokenMaxTtl = 120,
TokenPolicies = new[]
{
"default",
"dev",
"prod",
},
});
});
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/aws"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
aws, err := vault.NewAuthBackend(ctx, "aws", &vault.AuthBackendArgs{
Type: pulumi.String("aws"),
})
if err != nil {
return err
}
_, err = aws.NewAuthBackendRole(ctx, "example", &aws.AuthBackendRoleArgs{
Backend: aws.Path,
Role: pulumi.String("test-role"),
AuthType: pulumi.String("iam"),
BoundAmiIds: pulumi.StringArray{
pulumi.String("ami-8c1be5f6"),
},
BoundAccountIds: pulumi.StringArray{
pulumi.String("123456789012"),
},
BoundVpcIds: pulumi.StringArray{
pulumi.String("vpc-b61106d4"),
},
BoundSubnetIds: pulumi.StringArray{
pulumi.String("vpc-133128f1"),
},
BoundIamRoleArns: pulumi.StringArray{
pulumi.String("arn:aws:iam::123456789012:role/MyRole"),
},
BoundIamInstanceProfileArns: pulumi.StringArray{
pulumi.String("arn:aws:iam::123456789012:instance-profile/MyProfile"),
},
InferredEntityType: pulumi.String("ec2_instance"),
InferredAwsRegion: pulumi.String("us-east-1"),
TokenTtl: pulumi.Int(60),
TokenMaxTtl: pulumi.Int(120),
TokenPolicies: pulumi.StringArray{
pulumi.String("default"),
pulumi.String("dev"),
pulumi.String("prod"),
},
})
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.vault.AuthBackend;
import com.pulumi.vault.AuthBackendArgs;
import com.pulumi.vault.aws.AuthBackendRole;
import com.pulumi.vault.aws.AuthBackendRoleArgs;
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 aws = new AuthBackend("aws", AuthBackendArgs.builder()
.type("aws")
.build());
var example = new AuthBackendRole("example", AuthBackendRoleArgs.builder()
.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")
.build());
}
}
resources:
aws:
type: vault:AuthBackend
properties:
type: aws
example:
type: vault:aws:AuthBackendRole
properties:
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
Import
AWS auth backend roles can be imported using auth/
, the backend
path, /role/
, and the role
name e.g.
$ pulumi import vault:aws/authBackendRole:AuthBackendRole example auth/aws/role/test-role
Constructors
Properties
If set to true
, allows migration of the underlying instance where the client resides.
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.
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.
Only EC2 instances that match this instance ID will be permitted to log in.
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.
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.
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.
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.
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.
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.
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
.
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
.
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
.
Only valid when auth_type
is iam
. If set to true
, the bound_iam_principal_arns
are resolved to [AWS Unique
Specifies the blocks of IP addresses which are allowed to use the generated token
Generated Token's Explicit Maximum TTL in seconds
The maximum lifetime of the generated token
If true, the 'default' policy will not automatically be added to generated tokens
The maximum number of times a token may be used, a value of zero means unlimited
Generated Token's Period
Generated Token's Policies