Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.vault.aws.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.vault.aws.AuthBackendRoleArgs.builder
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* 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
*
* ```typescript
* 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",
* ],
* });
* ```
* ```python
* 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",
* ])
* ```
* ```csharp
* 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",
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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.
* ```sh
* $ pulumi import vault:aws/authBackendRole:AuthBackendRole example auth/aws/role/test-role
* ```
* @property allowInstanceMigration If set to `true`, allows migration of
* the underlying instance where the client resides.
* @property authType The auth type permitted for this role. Valid choices
* are `ec2` and `iam`. Defaults to `iam`.
* @property backend Path to the mounted aws auth backend.
* @property 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.
* @property 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.
* @property boundEc2InstanceIds Only EC2 instances that match this instance ID will be permitted to log in.
* @property 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.
* @property 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.
* @property 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.
* @property 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.
* @property 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.
* @property 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.
* @property 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`.
* @property 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`.
* @property 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`.
* @property namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
* @property resolveAwsUniqueIds Only valid when
* `auth_type` is `iam`. If set to `true`, the `bound_iam_principal_arns` are
* resolved to [AWS Unique
* IDs](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-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.
* @property role The name of the role.
* @property 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.
* @property tokenBoundCidrs Specifies the blocks of IP addresses which are allowed to use the generated token
* @property tokenExplicitMaxTtl Generated Token's Explicit Maximum TTL in seconds
* @property tokenMaxTtl The maximum lifetime of the generated token
* @property tokenNoDefaultPolicy If true, the 'default' policy will not automatically be added to generated tokens
* @property tokenNumUses The maximum number of times a token may be used, a value of zero means unlimited
* @property tokenPeriod Generated Token's Period
* @property tokenPolicies Generated Token's Policies
* @property tokenTtl The initial ttl of the token to generate in seconds
* @property tokenType The type of token to generate, service or batch
*/
public data class AuthBackendRoleArgs(
public val allowInstanceMigration: Output? = null,
public val authType: Output? = null,
public val backend: Output? = null,
public val boundAccountIds: Output>? = null,
public val boundAmiIds: Output>? = null,
public val boundEc2InstanceIds: Output>? = null,
public val boundIamInstanceProfileArns: Output>? = null,
public val boundIamPrincipalArns: Output>? = null,
public val boundIamRoleArns: Output>? = null,
public val boundRegions: Output>? = null,
public val boundSubnetIds: Output>? = null,
public val boundVpcIds: Output>? = null,
public val disallowReauthentication: Output? = null,
public val inferredAwsRegion: Output? = null,
public val inferredEntityType: Output? = null,
public val namespace: Output? = null,
public val resolveAwsUniqueIds: Output? = null,
public val role: Output? = null,
public val roleTag: Output? = null,
public val tokenBoundCidrs: Output>? = null,
public val tokenExplicitMaxTtl: Output? = null,
public val tokenMaxTtl: Output? = null,
public val tokenNoDefaultPolicy: Output? = null,
public val tokenNumUses: Output? = null,
public val tokenPeriod: Output? = null,
public val tokenPolicies: Output>? = null,
public val tokenTtl: Output? = null,
public val tokenType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.aws.AuthBackendRoleArgs =
com.pulumi.vault.aws.AuthBackendRoleArgs.builder()
.allowInstanceMigration(allowInstanceMigration?.applyValue({ args0 -> args0 }))
.authType(authType?.applyValue({ args0 -> args0 }))
.backend(backend?.applyValue({ args0 -> args0 }))
.boundAccountIds(boundAccountIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundAmiIds(boundAmiIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundEc2InstanceIds(boundEc2InstanceIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundIamInstanceProfileArns(
boundIamInstanceProfileArns?.applyValue({ args0 ->
args0.map({ args0 ->
args0
})
}),
)
.boundIamPrincipalArns(boundIamPrincipalArns?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundIamRoleArns(boundIamRoleArns?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundRegions(boundRegions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundSubnetIds(boundSubnetIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.boundVpcIds(boundVpcIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.disallowReauthentication(disallowReauthentication?.applyValue({ args0 -> args0 }))
.inferredAwsRegion(inferredAwsRegion?.applyValue({ args0 -> args0 }))
.inferredEntityType(inferredEntityType?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.resolveAwsUniqueIds(resolveAwsUniqueIds?.applyValue({ args0 -> args0 }))
.role(role?.applyValue({ args0 -> args0 }))
.roleTag(roleTag?.applyValue({ args0 -> args0 }))
.tokenBoundCidrs(tokenBoundCidrs?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.tokenExplicitMaxTtl(tokenExplicitMaxTtl?.applyValue({ args0 -> args0 }))
.tokenMaxTtl(tokenMaxTtl?.applyValue({ args0 -> args0 }))
.tokenNoDefaultPolicy(tokenNoDefaultPolicy?.applyValue({ args0 -> args0 }))
.tokenNumUses(tokenNumUses?.applyValue({ args0 -> args0 }))
.tokenPeriod(tokenPeriod?.applyValue({ args0 -> args0 }))
.tokenPolicies(tokenPolicies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.tokenTtl(tokenTtl?.applyValue({ args0 -> args0 }))
.tokenType(tokenType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [AuthBackendRoleArgs].
*/
@PulumiTagMarker
public class AuthBackendRoleArgsBuilder internal constructor() {
private var allowInstanceMigration: Output? = null
private var authType: Output? = null
private var backend: Output? = null
private var boundAccountIds: Output>? = null
private var boundAmiIds: Output>? = null
private var boundEc2InstanceIds: Output>? = null
private var boundIamInstanceProfileArns: Output>? = null
private var boundIamPrincipalArns: Output>? = null
private var boundIamRoleArns: Output>? = null
private var boundRegions: Output>? = null
private var boundSubnetIds: Output>? = null
private var boundVpcIds: Output>? = null
private var disallowReauthentication: Output? = null
private var inferredAwsRegion: Output? = null
private var inferredEntityType: Output? = null
private var namespace: Output? = null
private var resolveAwsUniqueIds: Output? = null
private var role: Output? = null
private var roleTag: Output? = null
private var tokenBoundCidrs: Output>? = null
private var tokenExplicitMaxTtl: Output? = null
private var tokenMaxTtl: Output? = null
private var tokenNoDefaultPolicy: Output? = null
private var tokenNumUses: Output? = null
private var tokenPeriod: Output? = null
private var tokenPolicies: Output>? = null
private var tokenTtl: Output? = null
private var tokenType: Output? = null
/**
* @param value If set to `true`, allows migration of
* the underlying instance where the client resides.
*/
@JvmName("pdieigdhyahvtrtj")
public suspend fun allowInstanceMigration(`value`: Output) {
this.allowInstanceMigration = value
}
/**
* @param value The auth type permitted for this role. Valid choices
* are `ec2` and `iam`. Defaults to `iam`.
*/
@JvmName("ssyywuiekpmvmfwf")
public suspend fun authType(`value`: Output) {
this.authType = value
}
/**
* @param value Path to the mounted aws auth backend.
*/
@JvmName("gnbcslsexftmyaxq")
public suspend fun backend(`value`: Output) {
this.backend = value
}
/**
* @param value 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.
*/
@JvmName("miepbyjarmgmcaxv")
public suspend fun boundAccountIds(`value`: Output>) {
this.boundAccountIds = value
}
@JvmName("pjasrjcyaqptapyu")
public suspend fun boundAccountIds(vararg values: Output) {
this.boundAccountIds = Output.all(values.asList())
}
/**
* @param values 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.
*/
@JvmName("wyhjpnkjsgvxuxmv")
public suspend fun boundAccountIds(values: List