Class CfnLink

All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:00.525Z") @Stability(Stable) public class CfnLink extends CfnResource implements IInspectable
A CloudFormation AWS::Oam::Link.

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();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnLink

      protected CfnLink(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLink

      protected CfnLink(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLink

      @Stability(Stable) public CfnLink(@NotNull Construct scope, @NotNull String id, @NotNull CfnLinkProps props)
      Create a new AWS::Oam::Link.

      Parameters:
      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.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the link.

      For example, arn:aws:oam:us-west-1:111111111111:link:abcd1234-a123-456a-a12b-a123b456c789

    • getAttrLabel

      @Stability(Stable) @NotNull public String getAttrLabel()
      The friendly human-readable name used to identify this source account when it is viewed from the monitoring account.

      For example, my-account1 .

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      An array of key-value pairs to apply to the link.

      For more information, see Tag .

    • getResourceTypes

      @Stability(Stable) @NotNull public List<String> getResourceTypes()
      An array of strings that define which types of data that the source account shares with the monitoring account.

      Valid values are AWS::CloudWatch::Metric | AWS::Logs::LogGroup | AWS::XRay::Trace .

    • setResourceTypes

      @Stability(Stable) public void setResourceTypes(@NotNull List<String> value)
      An array of strings that define which types of data that the source account shares with the monitoring account.

      Valid values are AWS::CloudWatch::Metric | AWS::Logs::LogGroup | AWS::XRay::Trace .

    • getSinkIdentifier

      @Stability(Stable) @NotNull public String getSinkIdentifier()
      The ARN of the sink in the monitoring account that you want to link to.

      You can use ListSinks to find the ARNs of sinks.

    • setSinkIdentifier

      @Stability(Stable) public void setSinkIdentifier(@NotNull String value)
      The ARN of the sink in the monitoring account that you want to link to.

      You can use ListSinks to find the ARNs of sinks.

    • getLabelTemplate

      @Stability(Stable) @Nullable public 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.

      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
    • setLabelTemplate

      @Stability(Stable) public void setLabelTemplate(@Nullable 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.

      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