SecretBackendRole

class SecretBackendRole : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const aws = new vault.aws.SecretBackend("aws", {
accessKey: "AKIA.....",
secretKey: "AWS secret key",
});
const role = new vault.aws.SecretBackendRole("role", {
backend: aws.path,
name: "deploy",
credentialType: "iam_user",
policyDocument: `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}
`,
});
import pulumi
import pulumi_vault as vault
aws = vault.aws.SecretBackend("aws",
access_key="AKIA.....",
secret_key="AWS secret key")
role = vault.aws.SecretBackendRole("role",
backend=aws.path,
name="deploy",
credential_type="iam_user",
policy_document="""{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var aws = new Vault.Aws.SecretBackend("aws", new()
{
AccessKey = "AKIA.....",
SecretKey = "AWS secret key",
});
var role = new Vault.Aws.SecretBackendRole("role", new()
{
Backend = aws.Path,
Name = "deploy",
CredentialType = "iam_user",
PolicyDocument = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Effect"": ""Allow"",
""Action"": ""iam:*"",
""Resource"": ""*""
}
]
}
",
});
});
package main
import (
"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 := aws.NewSecretBackend(ctx, "aws", &aws.SecretBackendArgs{
AccessKey: pulumi.String("AKIA....."),
SecretKey: pulumi.String("AWS secret key"),
})
if err != nil {
return err
}
_, err = aws.NewSecretBackendRole(ctx, "role", &aws.SecretBackendRoleArgs{
Backend: aws.Path,
Name: pulumi.String("deploy"),
CredentialType: pulumi.String("iam_user"),
PolicyDocument: pulumi.String(`{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}
`),
})
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.aws.SecretBackend;
import com.pulumi.vault.aws.SecretBackendArgs;
import com.pulumi.vault.aws.SecretBackendRole;
import com.pulumi.vault.aws.SecretBackendRoleArgs;
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 SecretBackend("aws", SecretBackendArgs.builder()
.accessKey("AKIA.....")
.secretKey("AWS secret key")
.build());
var role = new SecretBackendRole("role", SecretBackendRoleArgs.builder()
.backend(aws.path())
.name("deploy")
.credentialType("iam_user")
.policyDocument("""
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}
""")
.build());
}
}
resources:
aws:
type: vault:aws:SecretBackend
properties:
accessKey: AKIA.....
secretKey: AWS secret key
role:
type: vault:aws:SecretBackendRole
properties:
backend: ${aws.path}
name: deploy
credentialType: iam_user
policyDocument: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}

Import

AWS secret backend roles can be imported using the path, e.g.

$ pulumi import vault:aws/secretBackendRole:SecretBackendRole role aws/roles/deploy

Properties

Link copied to clipboard
val backend: Output<String>

The path the AWS secret backend is mounted at, with no leading or trailing /s.

Link copied to clipboard
val credentialType: Output<String>

Specifies the type of credential to be used when retrieving credentials from the role. Must be one of iam_user, assumed_role, or federation_token.

Link copied to clipboard
val defaultStsTtl: Output<Int>

The default TTL in seconds for STS credentials. When a TTL is not specified when STS credentials are requested, and a default TTL is specified on the role, then this default TTL will be used. Valid only when credential_type is one of assumed_role or federation_token.

Link copied to clipboard
val externalId: Output<String>?

External ID to set for assume role creds. Valid only when credential_type is set to assumed_role.

Link copied to clipboard
val iamGroups: Output<List<String>>?

A list of IAM group names. IAM users generated against this vault role will be added to these IAM Groups. For a credential type of assumed_role or federation_token, the policies sent to the corresponding AWS call (sts:AssumeRole or sts:GetFederation) will be the policies from each group in iam_groups combined with the policy_document and policy_arns parameters.

Link copied to clipboard
val iamTags: Output<Map<String, String>>?

A map of strings representing key/value pairs to be used as tags for any IAM user that is created by this role.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val maxStsTtl: Output<Int>

The max allowed TTL in seconds for STS credentials (credentials TTL are capped to max_sts_ttl). Valid only when credential_type is one of assumed_role or federation_token.

Link copied to clipboard
val name: Output<String>

The name to identify this role within the backend. Must be unique within the backend.

Link copied to clipboard
val namespace: Output<String>?

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. Available only for Vault Enterprise.

Link copied to clipboard

The ARN of the AWS Permissions Boundary to attach to IAM users created in the role. Valid only when credential_type is iam_user. If not specified, then no permissions boundary policy will be attached.

Link copied to clipboard
val policyArns: Output<List<String>>?

Specifies a list of AWS managed policy ARNs. The behavior depends on the credential type. With iam_user, the policies will be attached to IAM users when they are requested. With assumed_role and federation_token, the policy ARNs will act as a filter on what the credentials can do, similar to policy_document. When credential_type is iam_user or federation_token, at least one of policy_document or policy_arns must be specified.

Link copied to clipboard
val policyDocument: Output<String>?

The IAM policy document for the role. The behavior depends on the credential type. With iam_user, the policy document will be attached to the IAM user generated and augment the permissions the IAM user has. With assumed_role and federation_token, the policy document will act as a filter on what the credentials can do, similar to policy_arns.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val roleArns: Output<List<String>>?

Specifies the ARNs of the AWS roles this Vault role is allowed to assume. Required when credential_type is assumed_role and prohibited otherwise.

Link copied to clipboard
val sessionTags: Output<Map<String, String>>?

A map of strings representing key/value pairs to be set during assume role creds creation. Valid only when credential_type is set to assumed_role.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userPath: Output<String>?

The path for the user name. Valid only when credential_type is iam_user. Default is /.