Class CfnLink

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:11.469Z") @Stability(Stable) public class CfnLink extends CfnResource implements IInspectable, ITaggable
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")
         .linkConfiguration(LinkConfigurationProperty.builder()
                 .logGroupConfiguration(LinkFilterProperty.builder()
                         .filter("filter")
                         .build())
                 .metricConfiguration(LinkFilterProperty.builder()
                         .filter("filter")
                         .build())
                 .build())
         .tags(Map.of(
                 "tagsKey", "tags"))
         .build();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnLinkProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • 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.
    • 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.
    • getSinkIdentifier

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

      @Stability(Stable) public void setSinkIdentifier(@NotNull String value)
      The ARN of the sink in the monitoring account that you want to link to.
    • 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.
    • 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.
    • getLinkConfiguration

      @Stability(Stable) @Nullable public Object getLinkConfiguration()
      Use this structure to optionally create filters that specify that only some metric namespaces or log groups are to be shared from the source account to the monitoring account.
    • setLinkConfiguration

      @Stability(Stable) public void setLinkConfiguration(@Nullable IResolvable value)
      Use this structure to optionally create filters that specify that only some metric namespaces or log groups are to be shared from the source account to the monitoring account.
    • setLinkConfiguration

      @Stability(Stable) public void setLinkConfiguration(@Nullable CfnLink.LinkConfigurationProperty value)
      Use this structure to optionally create filters that specify that only some metric namespaces or log groups are to be shared from the source account to the monitoring account.
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
      An array of key-value pairs to apply to the link.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
      An array of key-value pairs to apply to the link.