Try AWS Native preview for resources not in the classic version.
aws.rolesanywhere.Profile
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Resource for managing a Roles Anywhere Profile.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.iam.Role("test", {
name: "test",
path: "/",
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: [
"sts:AssumeRole",
"sts:TagSession",
"sts:SetSourceIdentity",
],
Principal: {
Service: "rolesanywhere.amazonaws.com",
},
Effect: "Allow",
Sid: "",
}],
}),
});
const testProfile = new aws.rolesanywhere.Profile("test", {
name: "example",
roleArns: [test.arn],
});
import pulumi
import json
import pulumi_aws as aws
test = aws.iam.Role("test",
name="test",
path="/",
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Action": [
"sts:AssumeRole",
"sts:TagSession",
"sts:SetSourceIdentity",
],
"Principal": {
"Service": "rolesanywhere.amazonaws.com",
},
"Effect": "Allow",
"Sid": "",
}],
}))
test_profile = aws.rolesanywhere.Profile("test",
name="example",
role_arns=[test.arn])
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rolesanywhere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Action": []string{
"sts:AssumeRole",
"sts:TagSession",
"sts:SetSourceIdentity",
},
"Principal": map[string]interface{}{
"Service": "rolesanywhere.amazonaws.com",
},
"Effect": "Allow",
"Sid": "",
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
test, err := iam.NewRole(ctx, "test", &iam.RoleArgs{
Name: pulumi.String("test"),
Path: pulumi.String("/"),
AssumeRolePolicy: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = rolesanywhere.NewProfile(ctx, "test", &rolesanywhere.ProfileArgs{
Name: pulumi.String("example"),
RoleArns: pulumi.StringArray{
test.Arn,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Iam.Role("test", new()
{
Name = "test",
Path = "/",
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = new[]
{
"sts:AssumeRole",
"sts:TagSession",
"sts:SetSourceIdentity",
},
["Principal"] = new Dictionary<string, object?>
{
["Service"] = "rolesanywhere.amazonaws.com",
},
["Effect"] = "Allow",
["Sid"] = "",
},
},
}),
});
var testProfile = new Aws.RolesAnywhere.Profile("test", new()
{
Name = "example",
RoleArns = new[]
{
test.Arn,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.rolesanywhere.Profile;
import com.pulumi.aws.rolesanywhere.ProfileArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 test = new Role("test", RoleArgs.builder()
.name("test")
.path("/")
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", jsonArray(
"sts:AssumeRole",
"sts:TagSession",
"sts:SetSourceIdentity"
)),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "rolesanywhere.amazonaws.com")
)),
jsonProperty("Effect", "Allow"),
jsonProperty("Sid", "")
)))
)))
.build());
var testProfile = new Profile("testProfile", ProfileArgs.builder()
.name("example")
.roleArns(test.arn())
.build());
}
}
resources:
test:
type: aws:iam:Role
properties:
name: test
path: /
assumeRolePolicy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Action:
- sts:AssumeRole
- sts:TagSession
- sts:SetSourceIdentity
Principal:
Service: rolesanywhere.amazonaws.com
Effect: Allow
Sid:
testProfile:
type: aws:rolesanywhere:Profile
name: test
properties:
name: example
roleArns:
- ${test.arn}
Create Profile Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Profile(name: string, args: ProfileArgs, opts?: CustomResourceOptions);
@overload
def Profile(resource_name: str,
args: ProfileArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Profile(resource_name: str,
opts: Optional[ResourceOptions] = None,
role_arns: Optional[Sequence[str]] = None,
duration_seconds: Optional[int] = None,
enabled: Optional[bool] = None,
managed_policy_arns: Optional[Sequence[str]] = None,
name: Optional[str] = None,
require_instance_properties: Optional[bool] = None,
session_policy: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewProfile(ctx *Context, name string, args ProfileArgs, opts ...ResourceOption) (*Profile, error)
public Profile(string name, ProfileArgs args, CustomResourceOptions? opts = null)
public Profile(String name, ProfileArgs args)
public Profile(String name, ProfileArgs args, CustomResourceOptions options)
type: aws:rolesanywhere:Profile
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ProfileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProfileArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProfileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProfileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProfileArgs
- 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 awsProfileResource = new Aws.RolesAnywhere.Profile("awsProfileResource", new()
{
RoleArns = new[]
{
"string",
},
DurationSeconds = 0,
Enabled = false,
ManagedPolicyArns = new[]
{
"string",
},
Name = "string",
RequireInstanceProperties = false,
SessionPolicy = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := rolesanywhere.NewProfile(ctx, "awsProfileResource", &rolesanywhere.ProfileArgs{
RoleArns: pulumi.StringArray{
pulumi.String("string"),
},
DurationSeconds: pulumi.Int(0),
Enabled: pulumi.Bool(false),
ManagedPolicyArns: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
RequireInstanceProperties: pulumi.Bool(false),
SessionPolicy: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var awsProfileResource = new Profile("awsProfileResource", ProfileArgs.builder()
.roleArns("string")
.durationSeconds(0)
.enabled(false)
.managedPolicyArns("string")
.name("string")
.requireInstanceProperties(false)
.sessionPolicy("string")
.tags(Map.of("string", "string"))
.build());
aws_profile_resource = aws.rolesanywhere.Profile("awsProfileResource",
role_arns=["string"],
duration_seconds=0,
enabled=False,
managed_policy_arns=["string"],
name="string",
require_instance_properties=False,
session_policy="string",
tags={
"string": "string",
})
const awsProfileResource = new aws.rolesanywhere.Profile("awsProfileResource", {
roleArns: ["string"],
durationSeconds: 0,
enabled: false,
managedPolicyArns: ["string"],
name: "string",
requireInstanceProperties: false,
sessionPolicy: "string",
tags: {
string: "string",
},
});
type: aws:rolesanywhere:Profile
properties:
durationSeconds: 0
enabled: false
managedPolicyArns:
- string
name: string
requireInstanceProperties: false
roleArns:
- string
sessionPolicy: string
tags:
string: string
Profile Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Profile resource accepts the following input properties:
- Role
Arns List<string> - A list of IAM roles that this profile can assume
- Duration
Seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- Enabled bool
- Whether or not the Profile is enabled.
- Managed
Policy List<string>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- Name string
- The name of the Profile.
- Require
Instance boolProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- Session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Role
Arns []string - A list of IAM roles that this profile can assume
- Duration
Seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- Enabled bool
- Whether or not the Profile is enabled.
- Managed
Policy []stringArns - A list of managed policy ARNs that apply to the vended session credentials.
- Name string
- The name of the Profile.
- Require
Instance boolProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- Session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- role
Arns List<String> - A list of IAM roles that this profile can assume
- duration
Seconds Integer - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled Boolean
- Whether or not the Profile is enabled.
- managed
Policy List<String>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name String
- The name of the Profile.
- require
Instance BooleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- session
Policy String - A session policy that applies to the trust boundary of the vended session credentials.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- role
Arns string[] - A list of IAM roles that this profile can assume
- duration
Seconds number - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled boolean
- Whether or not the Profile is enabled.
- managed
Policy string[]Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name string
- The name of the Profile.
- require
Instance booleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- role_
arns Sequence[str] - A list of IAM roles that this profile can assume
- duration_
seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled bool
- Whether or not the Profile is enabled.
- managed_
policy_ Sequence[str]arns - A list of managed policy ARNs that apply to the vended session credentials.
- name str
- The name of the Profile.
- require_
instance_ boolproperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- session_
policy str - A session policy that applies to the trust boundary of the vended session credentials.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- role
Arns List<String> - A list of IAM roles that this profile can assume
- duration
Seconds Number - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled Boolean
- Whether or not the Profile is enabled.
- managed
Policy List<String>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name String
- The name of the Profile.
- require
Instance BooleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- session
Policy String - A session policy that applies to the trust boundary of the vended session credentials.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Profile resource produces the following output properties:
Look up Existing Profile Resource
Get an existing Profile 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?: ProfileState, opts?: CustomResourceOptions): Profile
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
duration_seconds: Optional[int] = None,
enabled: Optional[bool] = None,
managed_policy_arns: Optional[Sequence[str]] = None,
name: Optional[str] = None,
require_instance_properties: Optional[bool] = None,
role_arns: Optional[Sequence[str]] = None,
session_policy: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Profile
func GetProfile(ctx *Context, name string, id IDInput, state *ProfileState, opts ...ResourceOption) (*Profile, error)
public static Profile Get(string name, Input<string> id, ProfileState? state, CustomResourceOptions? opts = null)
public static Profile get(String name, Output<String> id, ProfileState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Arn string
- Amazon Resource Name (ARN) of the Profile
- Duration
Seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- Enabled bool
- Whether or not the Profile is enabled.
- Managed
Policy List<string>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- Name string
- The name of the Profile.
- Require
Instance boolProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- Role
Arns List<string> - A list of IAM roles that this profile can assume
- Session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- Amazon Resource Name (ARN) of the Profile
- Duration
Seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- Enabled bool
- Whether or not the Profile is enabled.
- Managed
Policy []stringArns - A list of managed policy ARNs that apply to the vended session credentials.
- Name string
- The name of the Profile.
- Require
Instance boolProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- Role
Arns []string - A list of IAM roles that this profile can assume
- Session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the Profile
- duration
Seconds Integer - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled Boolean
- Whether or not the Profile is enabled.
- managed
Policy List<String>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name String
- The name of the Profile.
- require
Instance BooleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- role
Arns List<String> - A list of IAM roles that this profile can assume
- session
Policy String - A session policy that applies to the trust boundary of the vended session credentials.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- Amazon Resource Name (ARN) of the Profile
- duration
Seconds number - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled boolean
- Whether or not the Profile is enabled.
- managed
Policy string[]Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name string
- The name of the Profile.
- require
Instance booleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- role
Arns string[] - A list of IAM roles that this profile can assume
- session
Policy string - A session policy that applies to the trust boundary of the vended session credentials.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- Amazon Resource Name (ARN) of the Profile
- duration_
seconds int - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled bool
- Whether or not the Profile is enabled.
- managed_
policy_ Sequence[str]arns - A list of managed policy ARNs that apply to the vended session credentials.
- name str
- The name of the Profile.
- require_
instance_ boolproperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- role_
arns Sequence[str] - A list of IAM roles that this profile can assume
- session_
policy str - A session policy that applies to the trust boundary of the vended session credentials.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the Profile
- duration
Seconds Number - The number of seconds the vended session credentials are valid for. Defaults to 3600.
- enabled Boolean
- Whether or not the Profile is enabled.
- managed
Policy List<String>Arns - A list of managed policy ARNs that apply to the vended session credentials.
- name String
- The name of the Profile.
- require
Instance BooleanProperties - Specifies whether instance properties are required in CreateSession requests with this profile.
- role
Arns List<String> - A list of IAM roles that this profile can assume
- session
Policy String - A session policy that applies to the trust boundary of the vended session credentials.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import aws_rolesanywhere_profile
using its id
. For example:
$ pulumi import aws:rolesanywhere/profile:Profile example db138a85-8925-4f9f-a409-08231233cacf
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.