@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:46.836Z") public class CfnServiceLinkedRole extends CfnResource implements IInspectable
Creates an IAM role that is linked to a specific AWS service. The service controls the attached policies and when the role can be deleted. This helps ensure that the service is not broken by an unexpectedly changed or deleted role, which could put your AWS resources into an unknown state. Allowing the service to control the role helps improve service stability and proper cleanup when a service and its role are no longer needed. For more information, see Using service-linked roles in the IAM User Guide .
To attach a policy to this service-linked role, you must make the request using the AWS service that depends on this role.
Example:
CfnServiceLinkedRole slr = CfnServiceLinkedRole.Builder.create(this, "ElasticSLR") .awsServiceName("es.amazonaws.com") .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnServiceLinkedRole.Builder
A fluent builder for
CfnServiceLinkedRole . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnServiceLinkedRole(Construct scope,
java.lang.String id,
CfnServiceLinkedRoleProps props)
Create a new `AWS::IAM::ServiceLinkedRole`.
|
protected |
CfnServiceLinkedRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnServiceLinkedRole(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAwsServiceName()
The service principal for the AWS service to which this role is attached.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getCustomSuffix()
A string that you provide, which is combined with the service-provided prefix to form the complete role name.
|
java.lang.String |
getDescription()
The description of the role.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAwsServiceName(java.lang.String value)
The service principal for the AWS service to which this role is attached.
|
void |
setCustomSuffix(java.lang.String value)
A string that you provide, which is combined with the service-provided prefix to form the complete role name.
|
void |
setDescription(java.lang.String value)
The description of the role.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnServiceLinkedRole(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnServiceLinkedRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnServiceLinkedRole(Construct scope, java.lang.String id, CfnServiceLinkedRoleProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getAwsServiceName()
You use a string similar to a URL but without the http:// in front. For example: elasticbeanstalk.amazonaws.com
.
Service principals are unique and case-sensitive. To find the exact service principal for your service-linked role, see AWS services that work with IAM in the IAM User Guide . Look for the services that have Yes in the Service-Linked Role column. Choose the Yes link to view the service-linked role documentation for that service.
public void setAwsServiceName(java.lang.String value)
You use a string similar to a URL but without the http:// in front. For example: elasticbeanstalk.amazonaws.com
.
Service principals are unique and case-sensitive. To find the exact service principal for your service-linked role, see AWS services that work with IAM in the IAM User Guide . Look for the services that have Yes in the Service-Linked Role column. Choose the Yes link to view the service-linked role documentation for that service.
public java.lang.String getCustomSuffix()
If you make multiple requests for the same service, then you must supply a different CustomSuffix
for each request. Otherwise the request fails with a duplicate role name error. For example, you could add -1
or -debug
to the suffix.
Some services do not support the CustomSuffix
parameter. If you provide an optional suffix and the operation fails, try the operation again without the suffix.
public void setCustomSuffix(java.lang.String value)
If you make multiple requests for the same service, then you must supply a different CustomSuffix
for each request. Otherwise the request fails with a duplicate role name error. For example, you could add -1
or -debug
to the suffix.
Some services do not support the CustomSuffix
parameter. If you provide an optional suffix and the operation fails, try the operation again without the suffix.
public java.lang.String getDescription()
public void setDescription(java.lang.String value)