1. Packages
  2. HashiCorp Vault Provider
  3. API Docs
  4. aws
  5. AuthBackendStsRole
HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi

vault.aws.AuthBackendStsRole

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const aws = new vault.AuthBackend("aws", {type: "aws"});
const role = new vault.aws.AuthBackendStsRole("role", {
    backend: aws.path,
    accountId: "1234567890",
    stsRole: "arn:aws:iam::1234567890:role/my-role",
});
Copy
import pulumi
import pulumi_vault as vault

aws = vault.AuthBackend("aws", type="aws")
role = vault.aws.AuthBackendStsRole("role",
    backend=aws.path,
    account_id="1234567890",
    sts_role="arn:aws:iam::1234567890:role/my-role")
Copy
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.NewAuthBackendStsRole(ctx, "role", &aws.AuthBackendStsRoleArgs{
			Backend:   aws.Path,
			AccountId: pulumi.String("1234567890"),
			StsRole:   pulumi.String("arn:aws:iam::1234567890:role/my-role"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 role = new Vault.Aws.AuthBackendStsRole("role", new()
    {
        Backend = aws.Path,
        AccountId = "1234567890",
        StsRole = "arn:aws:iam::1234567890:role/my-role",
    });

});
Copy
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.AuthBackendStsRole;
import com.pulumi.vault.aws.AuthBackendStsRoleArgs;
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 role = new AuthBackendStsRole("role", AuthBackendStsRoleArgs.builder()
            .backend(aws.path())
            .accountId("1234567890")
            .stsRole("arn:aws:iam::1234567890:role/my-role")
            .build());

    }
}
Copy
resources:
  aws:
    type: vault:AuthBackend
    properties:
      type: aws
  role:
    type: vault:aws:AuthBackendStsRole
    properties:
      backend: ${aws.path}
      accountId: '1234567890'
      stsRole: arn:aws:iam::1234567890:role/my-role
Copy

Create AuthBackendStsRole Resource

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

Constructor syntax

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

@overload
def AuthBackendStsRole(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       account_id: Optional[str] = None,
                       sts_role: Optional[str] = None,
                       backend: Optional[str] = None,
                       external_id: Optional[str] = None,
                       namespace: Optional[str] = None)
func NewAuthBackendStsRole(ctx *Context, name string, args AuthBackendStsRoleArgs, opts ...ResourceOption) (*AuthBackendStsRole, error)
public AuthBackendStsRole(string name, AuthBackendStsRoleArgs args, CustomResourceOptions? opts = null)
public AuthBackendStsRole(String name, AuthBackendStsRoleArgs args)
public AuthBackendStsRole(String name, AuthBackendStsRoleArgs args, CustomResourceOptions options)
type: vault:aws:AuthBackendStsRole
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. AuthBackendStsRoleArgs
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. AuthBackendStsRoleArgs
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. AuthBackendStsRoleArgs
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. AuthBackendStsRoleArgs
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. AuthBackendStsRoleArgs
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 authBackendStsRoleResource = new Vault.Aws.AuthBackendStsRole("authBackendStsRoleResource", new()
{
    AccountId = "string",
    StsRole = "string",
    Backend = "string",
    ExternalId = "string",
    Namespace = "string",
});
Copy
example, err := aws.NewAuthBackendStsRole(ctx, "authBackendStsRoleResource", &aws.AuthBackendStsRoleArgs{
	AccountId:  pulumi.String("string"),
	StsRole:    pulumi.String("string"),
	Backend:    pulumi.String("string"),
	ExternalId: pulumi.String("string"),
	Namespace:  pulumi.String("string"),
})
Copy
var authBackendStsRoleResource = new AuthBackendStsRole("authBackendStsRoleResource", AuthBackendStsRoleArgs.builder()
    .accountId("string")
    .stsRole("string")
    .backend("string")
    .externalId("string")
    .namespace("string")
    .build());
Copy
auth_backend_sts_role_resource = vault.aws.AuthBackendStsRole("authBackendStsRoleResource",
    account_id="string",
    sts_role="string",
    backend="string",
    external_id="string",
    namespace="string")
Copy
const authBackendStsRoleResource = new vault.aws.AuthBackendStsRole("authBackendStsRoleResource", {
    accountId: "string",
    stsRole: "string",
    backend: "string",
    externalId: "string",
    namespace: "string",
});
Copy
type: vault:aws:AuthBackendStsRole
properties:
    accountId: string
    backend: string
    externalId: string
    namespace: string
    stsRole: string
Copy

AuthBackendStsRole 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 AuthBackendStsRole resource accepts the following input properties:

AccountId This property is required. string
The AWS account ID to configure the STS role for.
StsRole This property is required. string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
Backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
ExternalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
Namespace Changes to this property will trigger replacement. 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.
AccountId This property is required. string
The AWS account ID to configure the STS role for.
StsRole This property is required. string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
Backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
ExternalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
Namespace Changes to this property will trigger replacement. 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.
accountId This property is required. String
The AWS account ID to configure the STS role for.
stsRole This property is required. String
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
backend Changes to this property will trigger replacement. String
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId String
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.
accountId This property is required. string
The AWS account ID to configure the STS role for.
stsRole This property is required. string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.
account_id This property is required. str
The AWS account ID to configure the STS role for.
sts_role This property is required. str
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
backend Changes to this property will trigger replacement. str
The path the AWS auth backend being configured was mounted at. Defaults to aws.
external_id str
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. str
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.
accountId This property is required. String
The AWS account ID to configure the STS role for.
stsRole This property is required. String
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
backend Changes to this property will trigger replacement. String
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId String
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.

Outputs

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

Get an existing AuthBackendStsRole 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?: AuthBackendStsRoleState, opts?: CustomResourceOptions): AuthBackendStsRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        backend: Optional[str] = None,
        external_id: Optional[str] = None,
        namespace: Optional[str] = None,
        sts_role: Optional[str] = None) -> AuthBackendStsRole
func GetAuthBackendStsRole(ctx *Context, name string, id IDInput, state *AuthBackendStsRoleState, opts ...ResourceOption) (*AuthBackendStsRole, error)
public static AuthBackendStsRole Get(string name, Input<string> id, AuthBackendStsRoleState? state, CustomResourceOptions? opts = null)
public static AuthBackendStsRole get(String name, Output<String> id, AuthBackendStsRoleState state, CustomResourceOptions options)
resources:  _:    type: vault:aws:AuthBackendStsRole    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:
AccountId string
The AWS account ID to configure the STS role for.
Backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
ExternalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
Namespace Changes to this property will trigger replacement. 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.
StsRole string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
AccountId string
The AWS account ID to configure the STS role for.
Backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
ExternalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
Namespace Changes to this property will trigger replacement. 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.
StsRole string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
accountId String
The AWS account ID to configure the STS role for.
backend Changes to this property will trigger replacement. String
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId String
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.
stsRole String
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
accountId string
The AWS account ID to configure the STS role for.
backend Changes to this property will trigger replacement. string
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId string
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.
stsRole string
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
account_id str
The AWS account ID to configure the STS role for.
backend Changes to this property will trigger replacement. str
The path the AWS auth backend being configured was mounted at. Defaults to aws.
external_id str
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. str
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.
sts_role str
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.
accountId String
The AWS account ID to configure the STS role for.
backend Changes to this property will trigger replacement. String
The path the AWS auth backend being configured was mounted at. Defaults to aws.
externalId String
External ID expected by the STS role. The associated STS role must be configured to require the external ID. Requires Vault 1.17+.
namespace Changes to this property will trigger replacement. 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.
stsRole String
The STS role to assume when verifying requests made by EC2 instances in the account specified by account_id.

Import

AWS auth backend STS roles can be imported using auth/, the backend path, /config/sts/, and the account_id e.g.

$ pulumi import vault:aws/authBackendStsRole:AuthBackendStsRole example auth/aws/config/sts/1234567890
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.