aws.iam.ServiceLinkedRole
Explore with Pulumi AI
Provides an IAM service-linked role.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const elasticbeanstalk = new aws.iam.ServiceLinkedRole("elasticbeanstalk", {awsServiceName: "elasticbeanstalk.amazonaws.com"});
import pulumi
import pulumi_aws as aws
elasticbeanstalk = aws.iam.ServiceLinkedRole("elasticbeanstalk", aws_service_name="elasticbeanstalk.amazonaws.com")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.NewServiceLinkedRole(ctx, "elasticbeanstalk", &iam.ServiceLinkedRoleArgs{
AwsServiceName: pulumi.String("elasticbeanstalk.amazonaws.com"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var elasticbeanstalk = new Aws.Iam.ServiceLinkedRole("elasticbeanstalk", new()
{
AwsServiceName = "elasticbeanstalk.amazonaws.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.ServiceLinkedRole;
import com.pulumi.aws.iam.ServiceLinkedRoleArgs;
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 elasticbeanstalk = new ServiceLinkedRole("elasticbeanstalk", ServiceLinkedRoleArgs.builder()
.awsServiceName("elasticbeanstalk.amazonaws.com")
.build());
}
}
resources:
elasticbeanstalk:
type: aws:iam:ServiceLinkedRole
properties:
awsServiceName: elasticbeanstalk.amazonaws.com
Create ServiceLinkedRole Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceLinkedRole(name: string, args: ServiceLinkedRoleArgs, opts?: CustomResourceOptions);
@overload
def ServiceLinkedRole(resource_name: str,
args: ServiceLinkedRoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceLinkedRole(resource_name: str,
opts: Optional[ResourceOptions] = None,
aws_service_name: Optional[str] = None,
custom_suffix: Optional[str] = None,
description: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewServiceLinkedRole(ctx *Context, name string, args ServiceLinkedRoleArgs, opts ...ResourceOption) (*ServiceLinkedRole, error)
public ServiceLinkedRole(string name, ServiceLinkedRoleArgs args, CustomResourceOptions? opts = null)
public ServiceLinkedRole(String name, ServiceLinkedRoleArgs args)
public ServiceLinkedRole(String name, ServiceLinkedRoleArgs args, CustomResourceOptions options)
type: aws:iam:ServiceLinkedRole
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 ServiceLinkedRoleArgs
- 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 ServiceLinkedRoleArgs
- 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 ServiceLinkedRoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceLinkedRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceLinkedRoleArgs
- 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 serviceLinkedRoleResource = new Aws.Iam.ServiceLinkedRole("serviceLinkedRoleResource", new()
{
AwsServiceName = "string",
CustomSuffix = "string",
Description = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := iam.NewServiceLinkedRole(ctx, "serviceLinkedRoleResource", &iam.ServiceLinkedRoleArgs{
AwsServiceName: pulumi.String("string"),
CustomSuffix: pulumi.String("string"),
Description: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var serviceLinkedRoleResource = new ServiceLinkedRole("serviceLinkedRoleResource", ServiceLinkedRoleArgs.builder()
.awsServiceName("string")
.customSuffix("string")
.description("string")
.tags(Map.of("string", "string"))
.build());
service_linked_role_resource = aws.iam.ServiceLinkedRole("serviceLinkedRoleResource",
aws_service_name="string",
custom_suffix="string",
description="string",
tags={
"string": "string",
})
const serviceLinkedRoleResource = new aws.iam.ServiceLinkedRole("serviceLinkedRoleResource", {
awsServiceName: "string",
customSuffix: "string",
description: "string",
tags: {
string: "string",
},
});
type: aws:iam:ServiceLinkedRole
properties:
awsServiceName: string
customSuffix: string
description: string
tags:
string: string
ServiceLinkedRole 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 ServiceLinkedRole resource accepts the following input properties:
- Aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - Custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- Description string
- The description of the role.
- Dictionary<string, string>
- Key-value mapping of tags for the IAM role. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - Custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- Description string
- The description of the role.
- map[string]string
- Key-value mapping of tags for the IAM role. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- aws
Service StringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - custom
Suffix String - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description String
- The description of the role.
- Map<String,String>
- Key-value mapping of tags for the IAM role. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description string
- The description of the role.
- {[key: string]: string}
- Key-value mapping of tags for the IAM role. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- aws_
service_ strname - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - custom_
suffix str - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description str
- The description of the role.
- Mapping[str, str]
- Key-value mapping of tags for the IAM role. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- aws
Service StringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - custom
Suffix String - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description String
- The description of the role.
- Map<String>
- Key-value mapping of tags for the IAM role. 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 ServiceLinkedRole resource produces the following output properties:
- Arn string
- The Amazon Resource Name (ARN) specifying the role.
- Create
Date string - The creation date of the IAM role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the role.
- Path string
- The path of the role.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Unique
Id string - The stable and unique string identifying the role.
- Arn string
- The Amazon Resource Name (ARN) specifying the role.
- Create
Date string - The creation date of the IAM role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the role.
- Path string
- The path of the role.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Unique
Id string - The stable and unique string identifying the role.
- arn String
- The Amazon Resource Name (ARN) specifying the role.
- create
Date String - The creation date of the IAM role.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the role.
- path String
- The path of the role.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - unique
Id String - The stable and unique string identifying the role.
- arn string
- The Amazon Resource Name (ARN) specifying the role.
- create
Date string - The creation date of the IAM role.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the role.
- path string
- The path of the role.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - unique
Id string - The stable and unique string identifying the role.
- arn str
- The Amazon Resource Name (ARN) specifying the role.
- create_
date str - The creation date of the IAM role.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the role.
- path str
- The path of the role.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - unique_
id str - The stable and unique string identifying the role.
- arn String
- The Amazon Resource Name (ARN) specifying the role.
- create
Date String - The creation date of the IAM role.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the role.
- path String
- The path of the role.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - unique
Id String - The stable and unique string identifying the role.
Look up Existing ServiceLinkedRole Resource
Get an existing ServiceLinkedRole 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?: ServiceLinkedRoleState, opts?: CustomResourceOptions): ServiceLinkedRole
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
aws_service_name: Optional[str] = None,
create_date: Optional[str] = None,
custom_suffix: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
path: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
unique_id: Optional[str] = None) -> ServiceLinkedRole
func GetServiceLinkedRole(ctx *Context, name string, id IDInput, state *ServiceLinkedRoleState, opts ...ResourceOption) (*ServiceLinkedRole, error)
public static ServiceLinkedRole Get(string name, Input<string> id, ServiceLinkedRoleState? state, CustomResourceOptions? opts = null)
public static ServiceLinkedRole get(String name, Output<String> id, ServiceLinkedRoleState 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
- The Amazon Resource Name (ARN) specifying the role.
- Aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - Create
Date string - The creation date of the IAM role.
- Custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- Description string
- The description of the role.
- Name string
- The name of the role.
- Path string
- The path of the role.
- Dictionary<string, string>
- Key-value mapping of tags for the IAM role. 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. - Unique
Id string - The stable and unique string identifying the role.
- Arn string
- The Amazon Resource Name (ARN) specifying the role.
- Aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - Create
Date string - The creation date of the IAM role.
- Custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- Description string
- The description of the role.
- Name string
- The name of the role.
- Path string
- The path of the role.
- map[string]string
- Key-value mapping of tags for the IAM role. 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. - Unique
Id string - The stable and unique string identifying the role.
- arn String
- The Amazon Resource Name (ARN) specifying the role.
- aws
Service StringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - create
Date String - The creation date of the IAM role.
- custom
Suffix String - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description String
- The description of the role.
- name String
- The name of the role.
- path String
- The path of the role.
- Map<String,String>
- Key-value mapping of tags for the IAM role. 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. - unique
Id String - The stable and unique string identifying the role.
- arn string
- The Amazon Resource Name (ARN) specifying the role.
- aws
Service stringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - create
Date string - The creation date of the IAM role.
- custom
Suffix string - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description string
- The description of the role.
- name string
- The name of the role.
- path string
- The path of the role.
- {[key: string]: string}
- Key-value mapping of tags for the IAM role. 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. - unique
Id string - The stable and unique string identifying the role.
- arn str
- The Amazon Resource Name (ARN) specifying the role.
- aws_
service_ strname - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - create_
date str - The creation date of the IAM role.
- custom_
suffix str - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description str
- The description of the role.
- name str
- The name of the role.
- path str
- The path of the role.
- Mapping[str, str]
- Key-value mapping of tags for the IAM role. 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. - unique_
id str - The stable and unique string identifying the role.
- arn String
- The Amazon Resource Name (ARN) specifying the role.
- aws
Service StringName - The AWS service to which this role is attached. You use a string similar to a URL but without the
http://
in front. For example:elasticbeanstalk.amazonaws.com
. To find the full list of services that support service-linked roles, check the docs. - create
Date String - The creation date of the IAM role.
- custom
Suffix String - Additional string appended to the role name. Not all AWS services support custom suffixes.
- description String
- The description of the role.
- name String
- The name of the role.
- path String
- The path of the role.
- Map<String>
- Key-value mapping of tags for the IAM role. 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. - unique
Id String - The stable and unique string identifying the role.
Import
Using pulumi import
, import IAM service-linked roles using role ARN. For example:
$ pulumi import aws:iam/serviceLinkedRole:ServiceLinkedRole elasticbeanstalk arn:aws:iam::123456789012:role/aws-service-role/elasticbeanstalk.amazonaws.com/AWSServiceRoleForElasticBeanstalk
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.