CfnLinkPropsMixin
- class aws_cdk.mixins_preview.aws_oam.mixins.CfnLinkPropsMixin(props, *, strategy=None)
Bases:
MixinCreates 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:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
LinkConfigurationProperty
- class CfnLinkPropsMixin.LinkConfigurationProperty(*, log_group_configuration=None, metric_configuration=None)
Bases:
objectUse 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:
- 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.
- metric_configuration
Use this structure to filter which metric namespaces are to be shared from the source account to the monitoring account.
LinkFilterProperty
- class CfnLinkPropsMixin.LinkFilterProperty(*, filter=None)
Bases:
objectWhen used in
MetricConfigurationthis field specifies which metric namespaces are to be shared with the monitoring account.When used in
LogGroupConfigurationthis field specifies which log groups are to share their log events with the monitoring account. Use the termLogGroupNameand one or more of the following operands.- Parameters:
filter (
Optional[str]) – When used inMetricConfigurationthis field specifies which metric namespaces are to be shared with the monitoring account. When used inLogGroupConfigurationthis field specifies which log groups are to share their log events with the monitoring account. Use the termLogGroupNameand 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 areANDandOR. -=and!=-AND-OR-LIKEandNOT 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. -INandNOT IN, using parentheses( )Examples: -Namespace NOT LIKE 'AWS/%'includes only namespaces that don’t start withAWS/, 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 namesThis-Log-GroupandOther-Log-Group. -LogGroupName NOT IN ('Private-Log-Group', 'Private-Log-Group-2')includes all log groups except the log groups with namesPrivate-Log-GroupandPrivate-Log-Group-2. -LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'includes all log groups that have names that start withaws/lambda/orAWSLogs. .. epigraph:: If you are updating a link that uses filters, you can specify*as the only value for thefilterparameter to delete the filter and share all log groups with the monitoring account.- See:
- 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
MetricConfigurationthis field specifies which metric namespaces are to be shared with the monitoring account.When used in
LogGroupConfigurationthis field specifies which log groups are to share their log events with the monitoring account. Use the termLogGroupNameand 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
ANDandOR.=and!=ANDORLIKEandNOT 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.INandNOT IN, using parentheses( )
Examples:
Namespace NOT LIKE 'AWS/%'includes only namespaces that don’t start withAWS/, 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 namesThis-Log-GroupandOther-Log-Group.LogGroupName NOT IN ('Private-Log-Group', 'Private-Log-Group-2')includes all log groups except the log groups with namesPrivate-Log-GroupandPrivate-Log-Group-2.LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'includes all log groups that have names that start withaws/lambda/orAWSLogs.
If you are updating a link that uses filters, you can specify
*as the only value for thefilterparameter to delete the filter and share all log groups with the monitoring account.