This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.
cloudwatch¶
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.
- class
pulumi_aws.cloudwatch.AwaitableGetLogGroupResult(arn=None, creation_time=None, id=None, kms_key_id=None, name=None, retention_in_days=None, tags=None)¶
- class
pulumi_aws.cloudwatch.Dashboard(resource_name, opts=None, dashboard_body=None, dashboard_name=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Dashboard resource.
import pulumi import pulumi_aws as aws main = aws.cloudwatch.Dashboard("main", dashboard_body=""" { "widgets": [ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ "AWS/EC2", "CPUUtilization", "InstanceId", "i-012345" ] ], "period":300, "stat":"Average", "region":"us-east-1", "title":"EC2 Instance CPU" } }, { "type":"text", "x":0, "y":7, "width":3, "height":3, "properties":{ "markdown":"Hello world" } } ] } """, dashboard_name="my-dashboard")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
dashboard_body (pulumi.Input[str]) – The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
dashboard_name (pulumi.Input[str]) – The name of the dashboard.
dashboard_arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) of the dashboard.
dashboard_body: pulumi.Output[str] = None¶The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
dashboard_name: pulumi.Output[str] = None¶The name of the dashboard.
- static
get(resource_name, id, opts=None, dashboard_arn=None, dashboard_body=None, dashboard_name=None)¶ Get an existing Dashboard resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
dashboard_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the dashboard.
dashboard_body (pulumi.Input[str]) –
The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
dashboard_name (pulumi.Input[str]) – The name of the dashboard.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.EventPermission(resource_name, opts=None, action=None, condition=None, principal=None, statement_id=None, __props__=None, __name__=None, __opts__=None)¶ Provides a resource to create a CloudWatch Events permission to support cross-account events in the current account default event bus.
import pulumi import pulumi_aws as aws dev_account_access = aws.cloudwatch.EventPermission("devAccountAccess", principal="123456789012", statement_id="DevAccountAccess")
import pulumi import pulumi_aws as aws organization_access = aws.cloudwatch.EventPermission("organizationAccess", condition={ "key": "aws:PrincipalOrgID", "type": "StringEquals", "value": aws_organizations_organization["example"]["id"], }, principal="*", statement_id="OrganizationAccess")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
action (pulumi.Input[str]) – The action that you are enabling the other account to perform. Defaults to
events:PutEvents.condition (pulumi.Input[dict]) – Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
principal (pulumi.Input[str]) – The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify
*to permit any account to put events to your default event bus, optionally limited bycondition.statement_id (pulumi.Input[str]) – An identifier string for the external account that you are granting permissions to.
The condition object supports the following:
key(pulumi.Input[str]) - Key for the condition. Valid values:aws:PrincipalOrgID.type(pulumi.Input[str]) - Type of condition. Value values:StringEquals.value(pulumi.Input[str]) - Value for the key.
action: pulumi.Output[str] = None¶The action that you are enabling the other account to perform. Defaults to
events:PutEvents.
condition: pulumi.Output[dict] = None¶Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
key(str) - Key for the condition. Valid values:aws:PrincipalOrgID.type(str) - Type of condition. Value values:StringEquals.value(str) - Value for the key.
principal: pulumi.Output[str] = None¶The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify
*to permit any account to put events to your default event bus, optionally limited bycondition.
statement_id: pulumi.Output[str] = None¶An identifier string for the external account that you are granting permissions to.
- static
get(resource_name, id, opts=None, action=None, condition=None, principal=None, statement_id=None)¶ Get an existing EventPermission resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
action (pulumi.Input[str]) – The action that you are enabling the other account to perform. Defaults to
events:PutEvents.condition (pulumi.Input[dict]) – Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
principal (pulumi.Input[str]) – The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify
*to permit any account to put events to your default event bus, optionally limited bycondition.statement_id (pulumi.Input[str]) – An identifier string for the external account that you are granting permissions to.
The condition object supports the following:
key(pulumi.Input[str]) - Key for the condition. Valid values:aws:PrincipalOrgID.type(pulumi.Input[str]) - Type of condition. Value values:StringEquals.value(pulumi.Input[str]) - Value for the key.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.EventRule(resource_name, opts=None, description=None, event_pattern=None, is_enabled=None, name=None, name_prefix=None, role_arn=None, schedule_expression=None, tags=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Event Rule resource.
import pulumi import pulumi_aws as aws console = aws.cloudwatch.EventRule("console", description="Capture each AWS Console Sign In", event_pattern="""{ "detail-type": [ "AWS Console Sign In via CloudTrail" ] } """) aws_logins = aws.sns.Topic("awsLogins") sns = aws.cloudwatch.EventTarget("sns", arn=aws_logins.arn, rule=console.name) sns_topic_policy = aws_logins.arn.apply(lambda arn: aws.iam.get_policy_document(statements=[{ "actions": ["SNS:Publish"], "effect": "Allow", "principals": [{ "identifiers": ["events.amazonaws.com"], "type": "Service", }], "resources": [arn], }])) default = aws.sns.TopicPolicy("default", arn=aws_logins.arn, policy=sns_topic_policy.json)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – The description of the rule.
event_pattern (pulumi.Input[str]) – Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
is_enabled (pulumi.Input[bool]) – Whether the rule should be enabled (defaults to
true).name (pulumi.Input[str]) – The rule’s name. By default generated by this provider.
name_prefix (pulumi.Input[str]) – The rule’s name. Conflicts with
name.role_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
schedule_expression (pulumi.Input[str]) – The scheduling expression. For example,
cron(0 20 * * ? *)orrate(5 minutes).tags (pulumi.Input[dict]) – A map of tags to assign to the resource.
arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) of the rule.
description: pulumi.Output[str] = None¶The description of the rule.
event_pattern: pulumi.Output[str] = None¶Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
is_enabled: pulumi.Output[bool] = None¶Whether the rule should be enabled (defaults to
true).
name: pulumi.Output[str] = None¶The rule’s name. By default generated by this provider.
name_prefix: pulumi.Output[str] = None¶The rule’s name. Conflicts with
name.
role_arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
schedule_expression: pulumi.Output[str] = None¶The scheduling expression. For example,
cron(0 20 * * ? *)orrate(5 minutes).
A map of tags to assign to the resource.
- static
get(resource_name, id, opts=None, arn=None, description=None, event_pattern=None, is_enabled=None, name=None, name_prefix=None, role_arn=None, schedule_expression=None, tags=None)¶ Get an existing EventRule resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the rule.
description (pulumi.Input[str]) – The description of the rule.
event_pattern (pulumi.Input[str]) –
Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
is_enabled (pulumi.Input[bool]) – Whether the rule should be enabled (defaults to
true).name (pulumi.Input[str]) – The rule’s name. By default generated by this provider.
name_prefix (pulumi.Input[str]) – The rule’s name. Conflicts with
name.role_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
schedule_expression (pulumi.Input[str]) – The scheduling expression. For example,
cron(0 20 * * ? *)orrate(5 minutes).tags (pulumi.Input[dict]) – A map of tags to assign to the resource.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.EventTarget(resource_name, opts=None, arn=None, batch_target=None, ecs_target=None, input=None, input_path=None, input_transformer=None, kinesis_target=None, role_arn=None, rule=None, run_command_targets=None, sqs_target=None, target_id=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Event Target resource.
import pulumi import pulumi_aws as aws console = aws.cloudwatch.EventRule("console", description="Capture all EC2 scaling events", event_pattern="""{ "source": [ "aws.autoscaling" ], "detail-type": [ "EC2 Instance Launch Successful", "EC2 Instance Terminate Successful", "EC2 Instance Launch Unsuccessful", "EC2 Instance Terminate Unsuccessful" ] } """) test_stream = aws.kinesis.Stream("testStream", shard_count=1) yada = aws.cloudwatch.EventTarget("yada", arn=test_stream.arn, rule=console.name, run_command_targets=[ { "key": "tag:Name", "values": ["FooBar"], }, { "key": "InstanceIds", "values": ["i-162058cd308bffec2"], }, ])
import pulumi import pulumi_aws as aws ssm_lifecycle_trust = aws.iam.get_policy_document(statements=[{ "actions": ["sts:AssumeRole"], "principals": [{ "identifiers": ["events.amazonaws.com"], "type": "Service", }], }]) stop_instance = aws.ssm.Document("stopInstance", content=""" { "schemaVersion": "1.2", "description": "Stop an instance", "parameters": { }, "runtimeConfig": { "aws:runShellScript": { "properties": [ { "id": "0.aws:runShellScript", "runCommand": ["halt"] } ] } } } """, document_type="Command") ssm_lifecycle_policy_document = stop_instance.arn.apply(lambda arn: aws.iam.get_policy_document(statements=[ { "actions": ["ssm:SendCommand"], "condition": [{ "test": "StringEquals", "values": ["*"], "variable": "ec2:ResourceTag/Terminate", }], "effect": "Allow", "resources": ["arn:aws:ec2:eu-west-1:1234567890:instance/*"], }, { "actions": ["ssm:SendCommand"], "effect": "Allow", "resources": [arn], }, ])) ssm_lifecycle_role = aws.iam.Role("ssmLifecycleRole", assume_role_policy=ssm_lifecycle_trust.json) ssm_lifecycle_policy = aws.iam.Policy("ssmLifecyclePolicy", policy=ssm_lifecycle_policy_document.json) stop_instances_event_rule = aws.cloudwatch.EventRule("stopInstancesEventRule", description="Stop instances nightly", schedule_expression="cron(0 0 * * ? *)") stop_instances_event_target = aws.cloudwatch.EventTarget("stopInstancesEventTarget", arn=stop_instance.arn, role_arn=ssm_lifecycle_role.arn, rule=stop_instances_event_rule.name, run_command_targets=[{ "key": "tag:Terminate", "values": ["midnight"], }])
import pulumi import pulumi_aws as aws stop_instances_event_rule = aws.cloudwatch.EventRule("stopInstancesEventRule", description="Stop instances nightly", schedule_expression="cron(0 0 * * ? *)") stop_instances_event_target = aws.cloudwatch.EventTarget("stopInstancesEventTarget", arn=f"arn:aws:ssm:{var['aws_region']}::document/AWS-RunShellScript", input="{"commands":["halt"]}", role_arn=aws_iam_role["ssm_lifecycle"]["arn"], rule=stop_instances_event_rule.name, run_command_targets=[{ "key": "tag:Terminate", "values": ["midnight"], }])
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) associated of the target.
batch_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
ecs_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
input (pulumi.Input[str]) – Valid JSON text passed to the target.
input_path (pulumi.Input[str]) – The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
input_transformer (pulumi.Input[dict]) – Parameters used when you are providing a custom input to a target based on certain event data.
kinesis_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
role_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if
ecs_targetis used.rule (pulumi.Input[str]) – The name of the rule you want to add targets to.
run_command_targets (pulumi.Input[list]) – Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
sqs_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
target_id (pulumi.Input[str]) – The unique target assignment ID. If missing, will generate a random, unique id.
The batch_target object supports the following:
arraySize(pulumi.Input[float]) - The size of the array, if this is an array batch job. Valid values are integers between 2 and 10,000.jobAttempts(pulumi.Input[float]) - The number of times to attempt to retry, if the job fails. Valid values are 1 to 10.jobDefinition(pulumi.Input[str]) - The ARN or name of the job definition to use if the event target is an AWS Batch job. This job definition must already exist.jobName(pulumi.Input[str]) - The name to use for this execution of the job, if the target is an AWS Batch job.
The ecs_target object supports the following:
group(pulumi.Input[str]) - Specifies an ECS task group for the task. The maximum length is 255 characters.launch_type(pulumi.Input[str]) - Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. Valid values are EC2 or FARGATE.network_configuration(pulumi.Input[dict]) - Use this if the ECS task uses the awsvpc network mode. This specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. Required if launch_type is FARGATE because the awsvpc mode is required for Fargate tasks.assignPublicIp(pulumi.Input[bool]) - Assign a public IP address to the ENI (Fargate launch type only). Valid values aretrueorfalse. Defaultfalse.security_groups(pulumi.Input[list]) - The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used.subnets(pulumi.Input[list]) - The subnets associated with the task or service.
platform_version(pulumi.Input[str]) - Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions.taskCount(pulumi.Input[float]) - The number of tasks to create based on the TaskDefinition. The default is 1.taskDefinitionArn(pulumi.Input[str]) - The ARN of the task definition to use if the event target is an Amazon ECS cluster.
The input_transformer object supports the following:
inputPaths(pulumi.Input[dict]) - Key value pairs specified in the form of JSONPath (for example, time = $.time)inputTemplate(pulumi.Input[str]) - Structure containing the template body.
The kinesis_target object supports the following:
partitionKeyPath(pulumi.Input[str]) - The JSON path to be extracted from the event and used as the partition key.
The run_command_targets object supports the following:
key(pulumi.Input[str]) - Can be eithertag:tag-keyorInstanceIds.values(pulumi.Input[list]) - If Key istag:tag-key, Values is a list of tag values. If Key isInstanceIds, Values is a list of Amazon EC2 instance IDs.
The sqs_target object supports the following:
messageGroupId(pulumi.Input[str]) - The FIFO message group ID to use as the target.
arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) associated of the target.
batch_target: pulumi.Output[dict] = None¶Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
arraySize(float) - The size of the array, if this is an array batch job. Valid values are integers between 2 and 10,000.jobAttempts(float) - The number of times to attempt to retry, if the job fails. Valid values are 1 to 10.jobDefinition(str) - The ARN or name of the job definition to use if the event target is an AWS Batch job. This job definition must already exist.jobName(str) - The name to use for this execution of the job, if the target is an AWS Batch job.
ecs_target: pulumi.Output[dict] = None¶Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
group(str) - Specifies an ECS task group for the task. The maximum length is 255 characters.launch_type(str) - Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. Valid values are EC2 or FARGATE.network_configuration(dict) - Use this if the ECS task uses the awsvpc network mode. This specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. Required if launch_type is FARGATE because the awsvpc mode is required for Fargate tasks.assignPublicIp(bool) - Assign a public IP address to the ENI (Fargate launch type only). Valid values aretrueorfalse. Defaultfalse.security_groups(list) - The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used.subnets(list) - The subnets associated with the task or service.
platform_version(str) - Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions.taskCount(float) - The number of tasks to create based on the TaskDefinition. The default is 1.taskDefinitionArn(str) - The ARN of the task definition to use if the event target is an Amazon ECS cluster.
input: pulumi.Output[str] = None¶Valid JSON text passed to the target.
input_path: pulumi.Output[str] = None¶The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
input_transformer: pulumi.Output[dict] = None¶Parameters used when you are providing a custom input to a target based on certain event data.
inputPaths(dict) - Key value pairs specified in the form of JSONPath (for example, time = $.time)inputTemplate(str) - Structure containing the template body.
kinesis_target: pulumi.Output[dict] = None¶Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
partitionKeyPath(str) - The JSON path to be extracted from the event and used as the partition key.
role_arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if
ecs_targetis used.
rule: pulumi.Output[str] = None¶The name of the rule you want to add targets to.
run_command_targets: pulumi.Output[list] = None¶Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
key(str) - Can be eithertag:tag-keyorInstanceIds.values(list) - If Key istag:tag-key, Values is a list of tag values. If Key isInstanceIds, Values is a list of Amazon EC2 instance IDs.
sqs_target: pulumi.Output[dict] = None¶Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
messageGroupId(str) - The FIFO message group ID to use as the target.
target_id: pulumi.Output[str] = None¶The unique target assignment ID. If missing, will generate a random, unique id.
- static
get(resource_name, id, opts=None, arn=None, batch_target=None, ecs_target=None, input=None, input_path=None, input_transformer=None, kinesis_target=None, role_arn=None, rule=None, run_command_targets=None, sqs_target=None, target_id=None)¶ Get an existing EventTarget resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) associated of the target.
batch_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
ecs_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
input (pulumi.Input[str]) – Valid JSON text passed to the target.
input_path (pulumi.Input[str]) –
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
input_transformer (pulumi.Input[dict]) – Parameters used when you are providing a custom input to a target based on certain event data.
kinesis_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
role_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if
ecs_targetis used.rule (pulumi.Input[str]) – The name of the rule you want to add targets to.
run_command_targets (pulumi.Input[list]) – Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
sqs_target (pulumi.Input[dict]) – Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
target_id (pulumi.Input[str]) – The unique target assignment ID. If missing, will generate a random, unique id.
The batch_target object supports the following:
arraySize(pulumi.Input[float]) - The size of the array, if this is an array batch job. Valid values are integers between 2 and 10,000.jobAttempts(pulumi.Input[float]) - The number of times to attempt to retry, if the job fails. Valid values are 1 to 10.jobDefinition(pulumi.Input[str]) - The ARN or name of the job definition to use if the event target is an AWS Batch job. This job definition must already exist.jobName(pulumi.Input[str]) - The name to use for this execution of the job, if the target is an AWS Batch job.
The ecs_target object supports the following:
group(pulumi.Input[str]) - Specifies an ECS task group for the task. The maximum length is 255 characters.launch_type(pulumi.Input[str]) - Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. Valid values are EC2 or FARGATE.network_configuration(pulumi.Input[dict]) - Use this if the ECS task uses the awsvpc network mode. This specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. Required if launch_type is FARGATE because the awsvpc mode is required for Fargate tasks.assignPublicIp(pulumi.Input[bool]) - Assign a public IP address to the ENI (Fargate launch type only). Valid values aretrueorfalse. Defaultfalse.security_groups(pulumi.Input[list]) - The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used.subnets(pulumi.Input[list]) - The subnets associated with the task or service.
platform_version(pulumi.Input[str]) - Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions.taskCount(pulumi.Input[float]) - The number of tasks to create based on the TaskDefinition. The default is 1.taskDefinitionArn(pulumi.Input[str]) - The ARN of the task definition to use if the event target is an Amazon ECS cluster.
The input_transformer object supports the following:
inputPaths(pulumi.Input[dict]) - Key value pairs specified in the form of JSONPath (for example, time = $.time)inputTemplate(pulumi.Input[str]) - Structure containing the template body.
The kinesis_target object supports the following:
partitionKeyPath(pulumi.Input[str]) - The JSON path to be extracted from the event and used as the partition key.
The run_command_targets object supports the following:
key(pulumi.Input[str]) - Can be eithertag:tag-keyorInstanceIds.values(pulumi.Input[list]) - If Key istag:tag-key, Values is a list of tag values. If Key isInstanceIds, Values is a list of Amazon EC2 instance IDs.
The sqs_target object supports the following:
messageGroupId(pulumi.Input[str]) - The FIFO message group ID to use as the target.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.GetLogGroupResult(arn=None, creation_time=None, id=None, kms_key_id=None, name=None, retention_in_days=None, tags=None)¶ A collection of values returned by getLogGroup.
arn= None¶The ARN of the Cloudwatch log group
creation_time= None¶The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
id= None¶The provider-assigned unique ID for this managed resource.
kms_key_id= None¶The ARN of the KMS Key to use when encrypting log data.
retention_in_days= None¶The number of days log events retained in the specified log group.
A map of tags to assign to the resource.
- class
pulumi_aws.cloudwatch.LogDestination(resource_name, opts=None, name=None, role_arn=None, target_arn=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Logs destination resource.
import pulumi import pulumi_aws as aws test_destination = aws.cloudwatch.LogDestination("testDestination", role_arn=aws_iam_role["iam_for_cloudwatch"]["arn"], target_arn=aws_kinesis_stream["kinesis_for_cloudwatch"]["arn"])
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
name (pulumi.Input[str]) – A name for the log destination
role_arn (pulumi.Input[str]) – The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
target_arn (pulumi.Input[str]) – The ARN of the target Amazon Kinesis stream resource for the destination
arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) specifying the log destination.
name: pulumi.Output[str] = None¶A name for the log destination
role_arn: pulumi.Output[str] = None¶The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
target_arn: pulumi.Output[str] = None¶The ARN of the target Amazon Kinesis stream resource for the destination
- static
get(resource_name, id, opts=None, arn=None, name=None, role_arn=None, target_arn=None)¶ Get an existing LogDestination resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) specifying the log destination.
name (pulumi.Input[str]) – A name for the log destination
role_arn (pulumi.Input[str]) – The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
target_arn (pulumi.Input[str]) – The ARN of the target Amazon Kinesis stream resource for the destination
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogDestinationPolicy(resource_name, opts=None, access_policy=None, destination_name=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Logs destination policy resource.
import pulumi import pulumi_aws as aws test_destination = aws.cloudwatch.LogDestination("testDestination", role_arn=aws_iam_role["iam_for_cloudwatch"]["arn"], target_arn=aws_kinesis_stream["kinesis_for_cloudwatch"]["arn"]) test_destination_policy_policy_document = test_destination.arn.apply(lambda arn: aws.iam.get_policy_document(statements=[{ "actions": ["logs:PutSubscriptionFilter"], "effect": "Allow", "principals": [{ "identifiers": ["123456789012"], "type": "AWS", }], "resources": [arn], }])) test_destination_policy_log_destination_policy = aws.cloudwatch.LogDestinationPolicy("testDestinationPolicyLogDestinationPolicy", access_policy=test_destination_policy_policy_document.json, destination_name=test_destination.name)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
access_policy (pulumi.Input[str]) – The policy document. This is a JSON formatted string.
destination_name (pulumi.Input[str]) – A name for the subscription filter
access_policy: pulumi.Output[str] = None¶The policy document. This is a JSON formatted string.
destination_name: pulumi.Output[str] = None¶A name for the subscription filter
- static
get(resource_name, id, opts=None, access_policy=None, destination_name=None)¶ Get an existing LogDestinationPolicy resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
access_policy (pulumi.Input[str]) – The policy document. This is a JSON formatted string.
destination_name (pulumi.Input[str]) – A name for the subscription filter
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogGroup(resource_name, opts=None, kms_key_id=None, name=None, name_prefix=None, retention_in_days=None, tags=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Log Group resource.
import pulumi import pulumi_aws as aws yada = aws.cloudwatch.LogGroup("yada", tags={ "Application": "serviceA", "Environment": "production", })
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
kms_key_id (pulumi.Input[str]) – The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
name (pulumi.Input[str]) – The name of the log group. If omitted, this provider will assign a random, unique name.
name_prefix (pulumi.Input[str]) – Creates a unique name beginning with the specified prefix. Conflicts with
name.retention_in_days (pulumi.Input[float]) – Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
tags (pulumi.Input[dict]) – A map of tags to assign to the resource.
arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) specifying the log group.
kms_key_id: pulumi.Output[str] = None¶The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
name: pulumi.Output[str] = None¶The name of the log group. If omitted, this provider will assign a random, unique name.
name_prefix: pulumi.Output[str] = None¶Creates a unique name beginning with the specified prefix. Conflicts with
name.
retention_in_days: pulumi.Output[float] = None¶Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
A map of tags to assign to the resource.
- static
get(resource_name, id, opts=None, arn=None, kms_key_id=None, name=None, name_prefix=None, retention_in_days=None, tags=None)¶ Get an existing LogGroup resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) specifying the log group.
kms_key_id (pulumi.Input[str]) – The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
name (pulumi.Input[str]) – The name of the log group. If omitted, this provider will assign a random, unique name.
name_prefix (pulumi.Input[str]) – Creates a unique name beginning with the specified prefix. Conflicts with
name.retention_in_days (pulumi.Input[float]) – Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
tags (pulumi.Input[dict]) – A map of tags to assign to the resource.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogMetricFilter(resource_name, opts=None, log_group_name=None, metric_transformation=None, name=None, pattern=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Log Metric Filter resource.
import pulumi import pulumi_aws as aws dada = aws.cloudwatch.LogGroup("dada") yada = aws.cloudwatch.LogMetricFilter("yada", log_group_name=dada.name, metric_transformation={ "name": "EventCount", "namespace": "YourNamespace", "value": "1", }, pattern="")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
log_group_name (pulumi.Input[str]) – The name of the log group to associate the metric filter with.
metric_transformation (pulumi.Input[dict]) – A block defining collection of information needed to define how metric data gets emitted. See below.
name (pulumi.Input[str]) – A name for the metric filter.
pattern (pulumi.Input[str]) – A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
The metric_transformation object supports the following:
default_value(pulumi.Input[str]) - The value to emit when a filter pattern does not match a log event.name(pulumi.Input[str]) - The name of the CloudWatch metric to which the monitored log information should be published (e.g.ErrorCount)namespace(pulumi.Input[str]) - The destination namespace of the CloudWatch metric.value(pulumi.Input[str]) - What to publish to the metric. For example, if you’re counting the occurrences of a particular term like “Error”, the value will be “1” for each occurrence. If you’re counting the bytes transferred the published value will be the value in the log event.
log_group_name: pulumi.Output[str] = None¶The name of the log group to associate the metric filter with.
metric_transformation: pulumi.Output[dict] = None¶A block defining collection of information needed to define how metric data gets emitted. See below.
default_value(str) - The value to emit when a filter pattern does not match a log event.name(str) - The name of the CloudWatch metric to which the monitored log information should be published (e.g.ErrorCount)namespace(str) - The destination namespace of the CloudWatch metric.value(str) - What to publish to the metric. For example, if you’re counting the occurrences of a particular term like “Error”, the value will be “1” for each occurrence. If you’re counting the bytes transferred the published value will be the value in the log event.
name: pulumi.Output[str] = None¶A name for the metric filter.
pattern: pulumi.Output[str] = None¶A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
- static
get(resource_name, id, opts=None, log_group_name=None, metric_transformation=None, name=None, pattern=None)¶ Get an existing LogMetricFilter resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
log_group_name (pulumi.Input[str]) – The name of the log group to associate the metric filter with.
metric_transformation (pulumi.Input[dict]) – A block defining collection of information needed to define how metric data gets emitted. See below.
name (pulumi.Input[str]) – A name for the metric filter.
pattern (pulumi.Input[str]) –
A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
The metric_transformation object supports the following:
default_value(pulumi.Input[str]) - The value to emit when a filter pattern does not match a log event.name(pulumi.Input[str]) - The name of the CloudWatch metric to which the monitored log information should be published (e.g.ErrorCount)namespace(pulumi.Input[str]) - The destination namespace of the CloudWatch metric.value(pulumi.Input[str]) - What to publish to the metric. For example, if you’re counting the occurrences of a particular term like “Error”, the value will be “1” for each occurrence. If you’re counting the bytes transferred the published value will be the value in the log event.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogResourcePolicy(resource_name, opts=None, policy_document=None, policy_name=None, __props__=None, __name__=None, __opts__=None)¶ Provides a resource to manage a CloudWatch log resource policy.
import pulumi import pulumi_aws as aws elasticsearch_log_publishing_policy_policy_document = aws.iam.get_policy_document(statements=[{ "actions": [ "logs:CreateLogStream", "logs:PutLogEvents", "logs:PutLogEventsBatch", ], "principals": [{ "identifiers": ["es.amazonaws.com"], "type": "Service", }], "resources": ["arn:aws:logs:*"], }]) elasticsearch_log_publishing_policy_log_resource_policy = aws.cloudwatch.LogResourcePolicy("elasticsearch-log-publishing-policyLogResourcePolicy", policy_document=elasticsearch_log_publishing_policy_policy_document.json, policy_name="elasticsearch-log-publishing-policy")
import pulumi import pulumi_aws as aws route53_query_logging_policy_policy_document = aws.iam.get_policy_document(statements=[{ "actions": [ "logs:CreateLogStream", "logs:PutLogEvents", ], "principals": [{ "identifiers": ["route53.amazonaws.com"], "type": "Service", }], "resources": ["arn:aws:logs:*:*:log-group:/aws/route53/*"], }]) route53_query_logging_policy_log_resource_policy = aws.cloudwatch.LogResourcePolicy("route53-query-logging-policyLogResourcePolicy", policy_document=route53_query_logging_policy_policy_document.json, policy_name="route53-query-logging-policy")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
policy_document (pulumi.Input[str]) – Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
policy_name (pulumi.Input[str]) – Name of the resource policy.
policy_document: pulumi.Output[str] = None¶Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
policy_name: pulumi.Output[str] = None¶Name of the resource policy.
- static
get(resource_name, id, opts=None, policy_document=None, policy_name=None)¶ Get an existing LogResourcePolicy resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
policy_document (pulumi.Input[str]) – Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
policy_name (pulumi.Input[str]) – Name of the resource policy.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogStream(resource_name, opts=None, log_group_name=None, name=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Log Stream resource.
import pulumi import pulumi_aws as aws yada = aws.cloudwatch.LogGroup("yada") foo = aws.cloudwatch.LogStream("foo", log_group_name=yada.name)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
log_group_name (pulumi.Input[str]) – The name of the log group under which the log stream is to be created.
name (pulumi.Input[str]) – The name of the log stream. Must not be longer than 512 characters and must not contain
:
arn: pulumi.Output[str] = None¶The Amazon Resource Name (ARN) specifying the log stream.
log_group_name: pulumi.Output[str] = None¶The name of the log group under which the log stream is to be created.
name: pulumi.Output[str] = None¶The name of the log stream. Must not be longer than 512 characters and must not contain
:
- static
get(resource_name, id, opts=None, arn=None, log_group_name=None, name=None)¶ Get an existing LogStream resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) specifying the log stream.
log_group_name (pulumi.Input[str]) – The name of the log group under which the log stream is to be created.
name (pulumi.Input[str]) – The name of the log stream. Must not be longer than 512 characters and must not contain
:
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.LogSubscriptionFilter(resource_name, opts=None, destination_arn=None, distribution=None, filter_pattern=None, log_group=None, name=None, role_arn=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Logs subscription filter resource.
import pulumi import pulumi_aws as aws test_lambdafunction_logfilter = aws.cloudwatch.LogSubscriptionFilter("testLambdafunctionLogfilter", destination_arn=aws_kinesis_stream["test_logstream"]["arn"], distribution="Random", filter_pattern="logtype test", log_group="/aws/lambda/example_lambda_name", role_arn=aws_iam_role["iam_for_lambda"]["arn"])
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
destination_arn (pulumi.Input[str]) – The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
distribution (pulumi.Input[str]) – The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
filter_pattern (pulumi.Input[str]) – A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
log_group (pulumi.Input[dict]) – The name of the log group to associate the subscription filter with
name (pulumi.Input[str]) – A name for the subscription filter
role_arn (pulumi.Input[str]) – The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use
lambda.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
destination_arn: pulumi.Output[str] = None¶The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
distribution: pulumi.Output[str] = None¶The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
filter_pattern: pulumi.Output[str] = None¶A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
log_group: pulumi.Output[str] = None¶The name of the log group to associate the subscription filter with
name: pulumi.Output[str] = None¶A name for the subscription filter
role_arn: pulumi.Output[str] = None¶The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use
lambda.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
- static
get(resource_name, id, opts=None, destination_arn=None, distribution=None, filter_pattern=None, log_group=None, name=None, role_arn=None)¶ Get an existing LogSubscriptionFilter resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
destination_arn (pulumi.Input[str]) – The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
distribution (pulumi.Input[str]) – The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
filter_pattern (pulumi.Input[str]) – A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
log_group (pulumi.Input[dict]) – The name of the log group to associate the subscription filter with
name (pulumi.Input[str]) – A name for the subscription filter
role_arn (pulumi.Input[str]) – The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use
lambda.Permissionresource for granting access from CloudWatch logs to the destination Lambda function.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_aws.cloudwatch.MetricAlarm(resource_name, opts=None, actions_enabled=None, alarm_actions=None, alarm_description=None, comparison_operator=None, datapoints_to_alarm=None, dimensions=None, evaluate_low_sample_count_percentiles=None, evaluation_periods=None, extended_statistic=None, insufficient_data_actions=None, metric_name=None, metric_queries=None, name=None, namespace=None, ok_actions=None, period=None, statistic=None, tags=None, threshold=None, threshold_metric_id=None, treat_missing_data=None, unit=None, __props__=None, __name__=None, __opts__=None)¶ Provides a CloudWatch Metric Alarm resource.
import pulumi import pulumi_aws as aws foobar = aws.cloudwatch.MetricAlarm("foobar", alarm_description="This metric monitors ec2 cpu utilization", comparison_operator="GreaterThanOrEqualToThreshold", evaluation_periods="2", insufficient_data_actions=[], metric_name="CPUUtilization", namespace="AWS/EC2", period="120", statistic="Average", threshold="80")
import pulumi import pulumi_aws as aws bat_policy = aws.autoscaling.Policy("batPolicy", adjustment_type="ChangeInCapacity", autoscaling_group_name=aws_autoscaling_group["bar"]["name"], cooldown=300, scaling_adjustment=4) bat_metric_alarm = aws.cloudwatch.MetricAlarm("batMetricAlarm", alarm_actions=[bat_policy.arn], alarm_description="This metric monitors ec2 cpu utilization", comparison_operator="GreaterThanOrEqualToThreshold", dimensions={ "AutoScalingGroupName": aws_autoscaling_group["bar"]["name"], }, evaluation_periods="2", metric_name="CPUUtilization", namespace="AWS/EC2", period="120", statistic="Average", threshold="80")
import pulumi import pulumi_aws as aws foobar = aws.cloudwatch.MetricAlarm("foobar", alarm_description="Request error rate has exceeded 10%", comparison_operator="GreaterThanOrEqualToThreshold", evaluation_periods="2", insufficient_data_actions=[], metric_queries=[ { "expression": "m2/m1*100", "id": "e1", "label": "Error Rate", "returnData": "true", }, { "id": "m1", "metric": { "dimensions": { "LoadBalancer": "app/web", }, "metric_name": "RequestCount", "namespace": "AWS/ApplicationELB", "period": "120", "stat": "Sum", "unit": "Count", }, }, { "id": "m2", "metric": { "dimensions": { "LoadBalancer": "app/web", }, "metric_name": "HTTPCode_ELB_5XX_Count", "namespace": "AWS/ApplicationELB", "period": "120", "stat": "Sum", "unit": "Count", }, }, ], threshold="10")
import pulumi import pulumi_aws as aws xx_anomaly_detection = aws.cloudwatch.MetricAlarm("xxAnomalyDetection", alarm_description="This metric monitors ec2 cpu utilization", comparison_operator="GreaterThanUpperThreshold", evaluation_periods="2", insufficient_data_actions=[], metric_queries=[ { "expression": "ANOMALY_DETECTION_BAND(m1)", "id": "e1", "label": "CPUUtilization (Expected)", "returnData": "true", }, { "id": "m1", "metric": { "dimensions": { "InstanceId": "i-abc123", }, "metric_name": "CPUUtilization", "namespace": "AWS/EC2", "period": "120", "stat": "Average", "unit": "Count", }, "returnData": "true", }, ], threshold_metric_id="e1")
import pulumi import pulumi_aws as aws xxx_nlb_healthyhosts = aws.cloudwatch.MetricAlarm("xxxNlbHealthyhosts", comparison_operator="LessThanThreshold", evaluation_periods="1", metric_name="HealthyHostCount", namespace="AWS/NetworkELB", period="60", statistic="Average", threshold=var["logstash_servers_count"], alarm_description="Number of XXXX nodes healthy in Target Group", actions_enabled="true", alarm_actions=[aws_sns_topic["sns"]["arn"]], ok_actions=[aws_sns_topic["sns"]["arn"]], dimensions={ "TargetGroup": aws_lb_target_group["lb-tg"]["arn_suffix"], "LoadBalancer": aws_lb["lb"]["arn_suffix"], })
NOTE: You cannot create a metric alarm consisting of both
statisticandextended_statisticparameters. You must choose one or the other- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
actions_enabled (pulumi.Input[bool]) – Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to
true.alarm_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
alarm_description (pulumi.Input[str]) – The description for the alarm.
comparison_operator (pulumi.Input[str]) – The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported:
GreaterThanOrEqualToThreshold,GreaterThanThreshold,LessThanThreshold,LessThanOrEqualToThreshold. Additionally, the valuesLessThanLowerOrGreaterThanUpperThreshold,LessThanLowerThreshold, andGreaterThanUpperThresholdare used only for alarms based on anomaly detection models.datapoints_to_alarm (pulumi.Input[float]) – The number of datapoints that must be breaching to trigger the alarm.
dimensions (pulumi.Input[dict]) – The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
evaluate_low_sample_count_percentiles (pulumi.Input[str]) – Used only for alarms based on percentiles. If you specify
ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specifyevaluateor omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported:ignore, andevaluate.evaluation_periods (pulumi.Input[float]) – The number of periods over which data is compared to the specified threshold.
extended_statistic (pulumi.Input[str]) – The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
insufficient_data_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
metric_name (pulumi.Input[str]) – The name for this metric. See docs for supported metrics.
metric_queries (pulumi.Input[list]) – Enables you to create an alarm based on a metric math expression. You may specify at most 20.
name (pulumi.Input[str]) – The descriptive name for the alarm. This name must be unique within the user’s AWS account
namespace (pulumi.Input[str]) –
The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
ok_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
period (pulumi.Input[float]) – The period in seconds over which the specified
statis applied.statistic (pulumi.Input[str]) – The statistic to apply to the alarm’s associated metric. Either of the following is supported:
SampleCount,Average,Sum,Minimum,Maximumtags (pulumi.Input[dict]) – A map of tags to assign to the resource.
threshold (pulumi.Input[float]) – The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
threshold_metric_id (pulumi.Input[str]) – If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
treat_missing_data (pulumi.Input[str]) – Sets how this alarm is to handle missing data points. The following values are supported:
missing,ignore,breachingandnotBreaching. Defaults tomissing.unit (pulumi.Input[str]) – The unit for this metric.
The metric_queries object supports the following:
expression(pulumi.Input[str]) - The math expression to be performed on the returned data, if this object is performing a math expression. This expression can use the id of the other metrics to refer to those metrics, and can also use the id of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide.id(pulumi.Input[str]) - A short name used to tie this object to the results in the response. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.label(pulumi.Input[str]) - A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents.metric(pulumi.Input[dict]) - The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.dimensions(pulumi.Input[dict]) - The dimensions for this metric. For the list of available dimensions see the AWS documentation here.metric_name(pulumi.Input[str]) - The name for this metric. See docs for supported metrics.namespace(pulumi.Input[str]) - The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.period(pulumi.Input[float]) - The period in seconds over which the specifiedstatis applied.stat(pulumi.Input[str]) - The statistic to apply to this metric. Either of the following is supported:SampleCount,Average,Sum,Minimum,Maximumunit(pulumi.Input[str]) - The unit for this metric.
returnData(pulumi.Input[bool]) - Specify exactly onemetric_queryto betrueto use thatmetric_queryresult as the alarm.
actions_enabled: pulumi.Output[bool] = None¶Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to
true.
alarm_actions: pulumi.Output[list] = None¶The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
alarm_description: pulumi.Output[str] = None¶The description for the alarm.
arn: pulumi.Output[str] = None¶The ARN of the cloudwatch metric alarm.
comparison_operator: pulumi.Output[str] = None¶The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported:
GreaterThanOrEqualToThreshold,GreaterThanThreshold,LessThanThreshold,LessThanOrEqualToThreshold. Additionally, the valuesLessThanLowerOrGreaterThanUpperThreshold,LessThanLowerThreshold, andGreaterThanUpperThresholdare used only for alarms based on anomaly detection models.
datapoints_to_alarm: pulumi.Output[float] = None¶The number of datapoints that must be breaching to trigger the alarm.
dimensions: pulumi.Output[dict] = None¶The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
evaluate_low_sample_count_percentiles: pulumi.Output[str] = None¶Used only for alarms based on percentiles. If you specify
ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specifyevaluateor omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported:ignore, andevaluate.
evaluation_periods: pulumi.Output[float] = None¶The number of periods over which data is compared to the specified threshold.
extended_statistic: pulumi.Output[str] = None¶The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
insufficient_data_actions: pulumi.Output[list] = None¶The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
metric_name: pulumi.Output[str] = None¶The name for this metric. See docs for supported metrics.
metric_queries: pulumi.Output[list] = None¶Enables you to create an alarm based on a metric math expression. You may specify at most 20.
expression(str) - The math expression to be performed on the returned data, if this object is performing a math expression. This expression can use the id of the other metrics to refer to those metrics, and can also use the id of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide.id(str) - A short name used to tie this object to the results in the response. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.label(str) - A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents.metric(dict) - The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.dimensions(dict) - The dimensions for this metric. For the list of available dimensions see the AWS documentation here.metric_name(str) - The name for this metric. See docs for supported metrics.namespace(str) - The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.period(float) - The period in seconds over which the specifiedstatis applied.stat(str) - The statistic to apply to this metric. Either of the following is supported:SampleCount,Average,Sum,Minimum,Maximumunit(str) - The unit for this metric.
returnData(bool) - Specify exactly onemetric_queryto betrueto use thatmetric_queryresult as the alarm.
name: pulumi.Output[str] = None¶The descriptive name for the alarm. This name must be unique within the user’s AWS account
namespace: pulumi.Output[str] = None¶The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
ok_actions: pulumi.Output[list] = None¶The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
period: pulumi.Output[float] = None¶The period in seconds over which the specified
statis applied.
statistic: pulumi.Output[str] = None¶The statistic to apply to the alarm’s associated metric. Either of the following is supported:
SampleCount,Average,Sum,Minimum,Maximum
A map of tags to assign to the resource.
threshold: pulumi.Output[float] = None¶The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
threshold_metric_id: pulumi.Output[str] = None¶If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
treat_missing_data: pulumi.Output[str] = None¶Sets how this alarm is to handle missing data points. The following values are supported:
missing,ignore,breachingandnotBreaching. Defaults tomissing.
unit: pulumi.Output[str] = None¶The unit for this metric.
- static
get(resource_name, id, opts=None, actions_enabled=None, alarm_actions=None, alarm_description=None, arn=None, comparison_operator=None, datapoints_to_alarm=None, dimensions=None, evaluate_low_sample_count_percentiles=None, evaluation_periods=None, extended_statistic=None, insufficient_data_actions=None, metric_name=None, metric_queries=None, name=None, namespace=None, ok_actions=None, period=None, statistic=None, tags=None, threshold=None, threshold_metric_id=None, treat_missing_data=None, unit=None)¶ Get an existing MetricAlarm resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
actions_enabled (pulumi.Input[bool]) – Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to
true.alarm_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
alarm_description (pulumi.Input[str]) – The description for the alarm.
arn (pulumi.Input[str]) – The ARN of the cloudwatch metric alarm.
comparison_operator (pulumi.Input[str]) – The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported:
GreaterThanOrEqualToThreshold,GreaterThanThreshold,LessThanThreshold,LessThanOrEqualToThreshold. Additionally, the valuesLessThanLowerOrGreaterThanUpperThreshold,LessThanLowerThreshold, andGreaterThanUpperThresholdare used only for alarms based on anomaly detection models.datapoints_to_alarm (pulumi.Input[float]) – The number of datapoints that must be breaching to trigger the alarm.
dimensions (pulumi.Input[dict]) –
The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
evaluate_low_sample_count_percentiles (pulumi.Input[str]) – Used only for alarms based on percentiles. If you specify
ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specifyevaluateor omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported:ignore, andevaluate.evaluation_periods (pulumi.Input[float]) – The number of periods over which data is compared to the specified threshold.
extended_statistic (pulumi.Input[str]) – The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
insufficient_data_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
metric_name (pulumi.Input[str]) –
The name for this metric. See docs for supported metrics.
metric_queries (pulumi.Input[list]) – Enables you to create an alarm based on a metric math expression. You may specify at most 20.
name (pulumi.Input[str]) – The descriptive name for the alarm. This name must be unique within the user’s AWS account
namespace (pulumi.Input[str]) –
The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
ok_actions (pulumi.Input[list]) – The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
period (pulumi.Input[float]) – The period in seconds over which the specified
statis applied.statistic (pulumi.Input[str]) – The statistic to apply to the alarm’s associated metric. Either of the following is supported:
SampleCount,Average,Sum,Minimum,Maximumtags (pulumi.Input[dict]) – A map of tags to assign to the resource.
threshold (pulumi.Input[float]) – The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
threshold_metric_id (pulumi.Input[str]) – If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
treat_missing_data (pulumi.Input[str]) – Sets how this alarm is to handle missing data points. The following values are supported:
missing,ignore,breachingandnotBreaching. Defaults tomissing.unit (pulumi.Input[str]) – The unit for this metric.
The metric_queries object supports the following:
expression(pulumi.Input[str]) - The math expression to be performed on the returned data, if this object is performing a math expression. This expression can use the id of the other metrics to refer to those metrics, and can also use the id of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide.id(pulumi.Input[str]) - A short name used to tie this object to the results in the response. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.label(pulumi.Input[str]) - A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents.metric(pulumi.Input[dict]) - The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.dimensions(pulumi.Input[dict]) - The dimensions for this metric. For the list of available dimensions see the AWS documentation here.metric_name(pulumi.Input[str]) - The name for this metric. See docs for supported metrics.namespace(pulumi.Input[str]) - The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.period(pulumi.Input[float]) - The period in seconds over which the specifiedstatis applied.stat(pulumi.Input[str]) - The statistic to apply to this metric. Either of the following is supported:SampleCount,Average,Sum,Minimum,Maximumunit(pulumi.Input[str]) - The unit for this metric.
returnData(pulumi.Input[bool]) - Specify exactly onemetric_queryto betrueto use thatmetric_queryresult as the alarm.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
pulumi_aws.cloudwatch.get_log_group(name=None, tags=None, opts=None)¶Use this data source to get information about an AWS Cloudwatch Log Group
import pulumi import pulumi_aws as aws example = aws.cloudwatch.get_log_group(name="MyImportantLogs")
- Parameters
name (str) – The name of the Cloudwatch log group
tags (dict) – A map of tags to assign to the resource.