CfnLinkPropsMixin

class aws_cdk.mixins_preview.aws_oam.mixins.CfnLinkPropsMixin(props, *, strategy=None)

Bases: Mixin

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-oam-link.html

CloudformationResource:

AWS::Oam::Link

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_oam import mixins as oam_mixins

cfn_link_props_mixin = oam_mixins.CfnLinkPropsMixin(oam_mixins.CfnLinkMixinProps(
    label_template="labelTemplate",
    link_configuration=oam_mixins.CfnLinkPropsMixin.LinkConfigurationProperty(
        log_group_configuration=oam_mixins.CfnLinkPropsMixin.LinkFilterProperty(
            filter="filter"
        ),
        metric_configuration=oam_mixins.CfnLinkPropsMixin.LinkFilterProperty(
            filter="filter"
        )
    ),
    resource_types=["resourceTypes"],
    sink_identifier="sinkIdentifier",
    tags={
        "tags_key": "tags"
    }
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Oam::Link.

Parameters:
  • props (Union[CfnLinkMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['labelTemplate', 'linkConfiguration', 'resourceTypes', 'sinkIdentifier', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

LinkConfigurationProperty

class CfnLinkPropsMixin.LinkConfigurationProperty(*, log_group_configuration=None, metric_configuration=None)

Bases: object

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.

Parameters:
  • log_group_configuration (Union[IResolvable, LinkFilterProperty, Dict[str, Any], None]) – Use this structure to filter which log groups are to share log events from this source account to the monitoring account.

  • metric_configuration (Union[IResolvable, LinkFilterProperty, Dict[str, Any], None]) – Use this structure to filter which metric namespaces are to be shared from the source account to the monitoring account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-oam-link-linkconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_oam import mixins as oam_mixins

link_configuration_property = oam_mixins.CfnLinkPropsMixin.LinkConfigurationProperty(
    log_group_configuration=oam_mixins.CfnLinkPropsMixin.LinkFilterProperty(
        filter="filter"
    ),
    metric_configuration=oam_mixins.CfnLinkPropsMixin.LinkFilterProperty(
        filter="filter"
    )
)

Attributes

log_group_configuration

Use this structure to filter which log groups are to share log events from this source account to the monitoring account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-oam-link-linkconfiguration.html#cfn-oam-link-linkconfiguration-loggroupconfiguration

metric_configuration

Use this structure to filter which metric namespaces are to be shared from the source account to the monitoring account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-oam-link-linkconfiguration.html#cfn-oam-link-linkconfiguration-metricconfiguration

LinkFilterProperty

class CfnLinkPropsMixin.LinkFilterProperty(*, filter=None)

Bases: object

When used in MetricConfiguration this field specifies which metric namespaces are to be shared with the monitoring account.

When used in LogGroupConfiguration this field specifies which log groups are to share their log events with the monitoring account. Use the term LogGroupName and one or more of the following operands.

Parameters:

filter (Optional[str]) – When used in MetricConfiguration this field specifies which metric namespaces are to be shared with the monitoring account. When used in LogGroupConfiguration this field specifies which log groups are to share their log events with the monitoring account. Use the term LogGroupName and one or more of the following operands. Use single quotation marks (’) around log group names and metric namespaces. The matching of log group names and metric namespaces is case sensitive. Each filter has a limit of five conditional operands. Conditional operands are AND and OR . - = and != - AND - OR - LIKE and NOT LIKE . These can be used only as prefix searches. Include a % at the end of the string that you want to search for and include. - IN and NOT IN , using parentheses ( ) Examples: - Namespace NOT LIKE 'AWS/%' includes only namespaces that don’t start with AWS/ , such as custom namespaces. - Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3') includes only the metrics in the EC2, ELB , and Amazon S3 namespaces. - Namespace = 'AWS/EC2' OR Namespace NOT LIKE 'AWS/%' includes only the EC2 namespace and your custom namespaces. - LogGroupName IN ('This-Log-Group', 'Other-Log-Group') includes only the log groups with names This-Log-Group and Other-Log-Group . - LogGroupName NOT IN ('Private-Log-Group', 'Private-Log-Group-2') includes all log groups except the log groups with names Private-Log-Group and Private-Log-Group-2 . - LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%' includes all log groups that have names that start with aws/lambda/ or AWSLogs . .. epigraph:: If you are updating a link that uses filters, you can specify * as the only value for the filter parameter to delete the filter and share all log groups with the monitoring account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-oam-link-linkfilter.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_oam import mixins as oam_mixins

link_filter_property = oam_mixins.CfnLinkPropsMixin.LinkFilterProperty(
    filter="filter"
)

Attributes

filter

When used in MetricConfiguration this field specifies which metric namespaces are to be shared with the monitoring account.

When used in LogGroupConfiguration this field specifies which log groups are to share their log events with the monitoring account. Use the term LogGroupName and one or more of the following operands.

Use single quotation marks (’) around log group names and metric namespaces.

The matching of log group names and metric namespaces is case sensitive. Each filter has a limit of five conditional operands. Conditional operands are AND and OR .

  • = and !=

  • AND

  • OR

  • LIKE and NOT LIKE . These can be used only as prefix searches. Include a % at the end of the string that you want to search for and include.

  • IN and NOT IN , using parentheses ( )

Examples:

  • Namespace NOT LIKE 'AWS/%' includes only namespaces that don’t start with AWS/ , such as custom namespaces.

  • Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3') includes only the metrics in the EC2, ELB , and Amazon S3 namespaces.

  • Namespace = 'AWS/EC2' OR Namespace NOT LIKE 'AWS/%' includes only the EC2 namespace and your custom namespaces.

  • LogGroupName IN ('This-Log-Group', 'Other-Log-Group') includes only the log groups with names This-Log-Group and Other-Log-Group .

  • LogGroupName NOT IN ('Private-Log-Group', 'Private-Log-Group-2') includes all log groups except the log groups with names Private-Log-Group and Private-Log-Group-2 .

  • LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%' includes all log groups that have names that start with aws/lambda/ or AWSLogs .

If you are updating a link that uses filters, you can specify * as the only value for the filter parameter to delete the filter and share all log groups with the monitoring account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-oam-link-linkfilter.html#cfn-oam-link-linkfilter-filter