Provides an IAM service-linked role.
resource "aws_iam_service_linked_role" "elasticbeanstalk" {
aws_service_name = "elasticbeanstalk.amazonaws.com"
}
This resource supports the following arguments:
aws_service_name
- (Required, Forces new resource) 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
- (Optional, forces new resource) Additional string appended to the role name. Not all AWS services support custom suffixes.description
- (Optional) The description of the role.tags
- 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.This resource exports the following attributes in addition to the arguments above:
id
- The Amazon Resource Name (ARN) of the role.arn
- The Amazon Resource Name (ARN) specifying the role.create_date
- The creation date of the IAM role.name
- The name of the role.path
- The path of the role.unique_id
- The stable and unique string identifying the role.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import IAM service-linked roles using role ARN. For example:
import {
to = aws_iam_service_linked_role.elasticbeanstalk
id = "arn:aws:iam::123456789012:role/aws-service-role/elasticbeanstalk.amazonaws.com/AWSServiceRoleForElasticBeanstalk"
}
Using terraform import
, import IAM service-linked roles using role ARN. For example:
% terraform import aws_iam_service_linked_role.elasticbeanstalk arn:aws:iam::123456789012:role/aws-service-role/elasticbeanstalk.amazonaws.com/AWSServiceRoleForElasticBeanstalk