CfnMonitor
- class aws_cdk.aws_internetmonitor.CfnMonitor(scope, id, *, monitor_name, internet_measurements_log_delivery=None, max_city_networks_to_monitor=None, resources=None, resources_to_add=None, resources_to_remove=None, status=None, tags=None, traffic_percentage_to_monitor=None)
Bases:
CfnResource
A CloudFormation
AWS::InternetMonitor::Monitor
.The
AWS::InternetMonitor::Monitor
resource is an Internet Monitor resource type that contains information about how you create a monitor in Amazon CloudWatch Internet Monitor. A monitor in Internet Monitor provides visibility into performance and availability between your applications hosted on AWS and your end users, using a traffic profile that it creates based on the application resources that you add: Virtual Private Clouds (VPCs), Amazon CloudFront distributions, or WorkSpaces directories.Internet Monitor also alerts you to internet issues that impact your application in the city-networks (geographies and networks) where your end users use it. With Internet Monitor, you can quickly pinpoint the locations and providers that are affected, so that you can address the issue.
For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide .
- CloudformationResource:
AWS::InternetMonitor::Monitor
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_internetmonitor as internetmonitor cfn_monitor = internetmonitor.CfnMonitor(self, "MyCfnMonitor", monitor_name="monitorName", # the properties below are optional internet_measurements_log_delivery=internetmonitor.CfnMonitor.InternetMeasurementsLogDeliveryProperty( s3_config=internetmonitor.CfnMonitor.S3ConfigProperty( bucket_name="bucketName", bucket_prefix="bucketPrefix", log_delivery_status="logDeliveryStatus" ) ), max_city_networks_to_monitor=123, resources=["resources"], resources_to_add=["resourcesToAdd"], resources_to_remove=["resourcesToRemove"], status="status", tags=[CfnTag( key="key", value="value" )], traffic_percentage_to_monitor=123 )
Create a new
AWS::InternetMonitor::Monitor
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
monitor_name (
str
) – The name of the monitor. A monitor name can contain only alphanumeric characters, dashes (-), periods (.), and underscores (_).internet_measurements_log_delivery (
Union
[InternetMeasurementsLogDeliveryProperty
,Dict
[str
,Any
],IResolvable
,None
]) – Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket. Measurements are also published to Amazon CloudWatch Logs for the first 500 (by traffic volume) city-networks (client locations and ASNs, typically internet service providers or ISPs).max_city_networks_to_monitor (
Union
[int
,float
,None
]) – The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network, such as an internet service provider, that clients access the resources through. For more information, see Choosing a city-network maximum value in Using Amazon CloudWatch Internet Monitor .resources (
Optional
[Sequence
[str
]]) – The resources that have been added for the monitor, listed by their Amazon Resource Names (ARNs).resources_to_add (
Optional
[Sequence
[str
]]) – The resources to add to a monitor, which you provide as a set of Amazon Resource Names (ARNs). You can add a combination of Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add WorkSpaces directories. You can’t add all three types of resources. .. epigraph:: If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.resources_to_remove (
Optional
[Sequence
[str
]]) – The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).status (
Optional
[str
]) – The status of a monitor. The accepted values that you can specify forStatus
areACTIVE
andINACTIVE
.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – The tags for a monitor, listed as a set of key:value pairs.traffic_percentage_to_monitor (
Union
[int
,float
,None
]) – The percentage of the internet-facing traffic for your application that you want to monitor. You can also, optionally, set a limit for the number of city-networks (client locations and ASNs, typically internet service providers) that Internet Monitor will monitor traffic for. The city-networks maximum limit caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
)- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
)value (
Any
)
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
])apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
)- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::InternetMonitor::Monitor'
- attr_created_at
The time when the monitor was created.
- CloudformationAttribute:
CreatedAt
- attr_modified_at
The last time that the monitor was modified.
- CloudformationAttribute:
ModifiedAt
- attr_monitor_arn
The Amazon Resource Name (ARN) of the monitor.
- CloudformationAttribute:
MonitorArn
- attr_processing_status
The health of data processing for the monitor.
For more information, see
ProcessingStatus
under MonitorListMember in the Amazon CloudWatch Internet Monitor API Reference .- CloudformationAttribute:
ProcessingStatus
- attr_processing_status_info
Additional information about the health of the data processing for the monitor.
- CloudformationAttribute:
ProcessingStatusInfo
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- internet_measurements_log_delivery
Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket.
Measurements are also published to Amazon CloudWatch Logs for the first 500 (by traffic volume) city-networks (client locations and ASNs, typically internet service providers or ISPs).
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- max_city_networks_to_monitor
The maximum number of city-networks to monitor for your resources.
A city-network is the location (city) where clients access your application resources from and the network, such as an internet service provider, that clients access the resources through.
For more information, see Choosing a city-network maximum value in Using Amazon CloudWatch Internet Monitor .
- monitor_name
The name of the monitor.
A monitor name can contain only alphanumeric characters, dashes (-), periods (.), and underscores (_).
- node
The construct tree node associated with this construct.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- resources
The resources that have been added for the monitor, listed by their Amazon Resource Names (ARNs).
- resources_to_add
The resources to add to a monitor, which you provide as a set of Amazon Resource Names (ARNs).
You can add a combination of Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add WorkSpaces directories. You can’t add all three types of resources. .. epigraph:
If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.
- resources_to_remove
The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- status
The status of a monitor.
The accepted values that you can specify for
Status
areACTIVE
andINACTIVE
.
- traffic_percentage_to_monitor
The percentage of the internet-facing traffic for your application that you want to monitor.
You can also, optionally, set a limit for the number of city-networks (client locations and ASNs, typically internet service providers) that Internet Monitor will monitor traffic for. The city-networks maximum limit caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
)- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
)- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
)- Return type:
bool
InternetMeasurementsLogDeliveryProperty
- class CfnMonitor.InternetMeasurementsLogDeliveryProperty(*, s3_config=None)
Bases:
object
- Parameters:
s3_config (
Union
[IResolvable
,S3ConfigProperty
,Dict
[str
,Any
],None
]) – The configuration information for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3. The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status isENABLED
if you choose to deliver internet measurements to an S3 bucket, andDISABLED
otherwise.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_internetmonitor as internetmonitor internet_measurements_log_delivery_property = internetmonitor.CfnMonitor.InternetMeasurementsLogDeliveryProperty( s3_config=internetmonitor.CfnMonitor.S3ConfigProperty( bucket_name="bucketName", bucket_prefix="bucketPrefix", log_delivery_status="logDeliveryStatus" ) )
Attributes
- s3_config
The configuration information for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3.
The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status is
ENABLED
if you choose to deliver internet measurements to an S3 bucket, andDISABLED
otherwise.
S3ConfigProperty
- class CfnMonitor.S3ConfigProperty(*, bucket_name=None, bucket_prefix=None, log_delivery_status=None)
Bases:
object
The configuration for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3.
The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status is
ENABLED
if you choose to deliver internet measurements to S3 logs, andDISABLED
otherwise.- Parameters:
bucket_name (
Optional
[str
]) – The Amazon S3 bucket name for internet measurements publishing.bucket_prefix (
Optional
[str
]) – An optional Amazon S3 bucket prefix for internet measurements publishing.log_delivery_status (
Optional
[str
]) – The status of publishing Internet Monitor internet measurements to an Amazon S3 bucket. The delivery status isENABLED
if you choose to deliver internet measurements to an S3 bucket, andDISABLED
otherwise.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_internetmonitor as internetmonitor s3_config_property = internetmonitor.CfnMonitor.S3ConfigProperty( bucket_name="bucketName", bucket_prefix="bucketPrefix", log_delivery_status="logDeliveryStatus" )
Attributes
- bucket_name
The Amazon S3 bucket name for internet measurements publishing.
- bucket_prefix
An optional Amazon S3 bucket prefix for internet measurements publishing.
- log_delivery_status
The status of publishing Internet Monitor internet measurements to an Amazon S3 bucket.
The delivery status is
ENABLED
if you choose to deliver internet measurements to an S3 bucket, andDISABLED
otherwise.