@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:38.977Z") public class CfnLink extends CfnResource implements IInspectable
Creates a link between a source account and a sink that you have created in a monitoring account.
Before you create a link, you must create a sink in the monitoring account. The sink must have a sink policy that permits the source account to link to it. You can grant permission to source accounts by granting permission to an entire organization, an organizational unit, or to individual accounts.
For more information, see CreateSink and PutSinkPolicy .
Each monitoring account can be linked to as many as 100,000 source accounts.
Each source account can be linked to as many as five monitoring accounts.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.oam.*; CfnLink cfnLink = CfnLink.Builder.create(this, "MyCfnLink") .resourceTypes(List.of("resourceTypes")) .sinkIdentifier("sinkIdentifier") // the properties below are optional .labelTemplate("labelTemplate") .tags(Map.of( "tagsKey", "tags")) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnLink.Builder
A fluent builder for
CfnLink . |
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 |
---|---|
|
CfnLink(Construct scope,
java.lang.String id,
CfnLinkProps props)
Create a new `AWS::Oam::Link`.
|
protected |
CfnLink(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLink(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The ARN of the link.
|
java.lang.String |
getAttrLabel()
The friendly human-readable name used to identify this source account when it is viewed from the monitoring account.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getLabelTemplate()
Specify a friendly human-readable name to use to identify this source account when you are viewing data from it in the monitoring account.
|
java.util.List<java.lang.String> |
getResourceTypes()
An array of strings that define which types of data that the source account shares with the monitoring account.
|
java.lang.String |
getSinkIdentifier()
The ARN of the sink in the monitoring account that you want to link to.
|
TagManager |
getTags()
An array of key-value pairs to apply to the link.
|
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 |
setLabelTemplate(java.lang.String value)
Specify a friendly human-readable name to use to identify this source account when you are viewing data from it in the monitoring account.
|
void |
setResourceTypes(java.util.List<java.lang.String> value)
An array of strings that define which types of data that the source account shares with the monitoring account.
|
void |
setSinkIdentifier(java.lang.String value)
The ARN of the sink in the monitoring account that you want to link to.
|
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 CfnLink(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLink(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnLink(Construct scope, java.lang.String id, CfnLinkProps 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.public java.lang.String getAttrArn()
For example, arn:aws:oam:us-west-1:111111111111:link:abcd1234-a123-456a-a12b-a123b456c789
public java.lang.String getAttrLabel()
For example, my-account1
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
For more information, see Tag .
public java.util.List<java.lang.String> getResourceTypes()
Valid values are AWS::CloudWatch::Metric | AWS::Logs::LogGroup | AWS::XRay::Trace
.
public void setResourceTypes(java.util.List<java.lang.String> value)
Valid values are AWS::CloudWatch::Metric | AWS::Logs::LogGroup | AWS::XRay::Trace
.
public java.lang.String getSinkIdentifier()
You can use ListSinks to find the ARNs of sinks.
public void setSinkIdentifier(java.lang.String value)
You can use ListSinks to find the ARNs of sinks.
public java.lang.String getLabelTemplate()
You can include the following variables in your template:
$AccountName
is the name of the account$AccountEmail
is a globally-unique email address, which includes the email domain, such as mariagarcia@example.com
$AccountEmailNoDomain
is an email address without the domain name, such as mariagarcia
public void setLabelTemplate(java.lang.String value)
You can include the following variables in your template:
$AccountName
is the name of the account$AccountEmail
is a globally-unique email address, which includes the email domain, such as mariagarcia@example.com
$AccountEmailNoDomain
is an email address without the domain name, such as mariagarcia