id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
acm-ug-037 | acm-ug.pdf | 37 | use cases that require long- term credentials in the IAM User Guide. An IAM group is an identity that specifies a collection of IAM users. You can't sign in as a group. You can use groups to specify permissions for multiple users at a time. Groups make permissions easier to manage for large sets of users. For example, you could have a group named IAMAdmins and give that group permissions to administer IAM resources. Users are different from roles. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it. Users have permanent long-term credentials, but roles provide temporary credentials. To learn more, see Use cases for IAM users in the IAM User Guide. IAM roles An IAM role is an identity within your AWS account that has specific permissions. It is similar to an IAM user, but is not associated with a specific person. To temporarily assume an IAM role in the AWS Management Console, you can switch from a user to an IAM role (console). You can assume a role by calling an AWS CLI or AWS API operation or by using a custom URL. For more information about methods for using roles, see Methods to assume a role in the IAM User Guide. IAM roles with temporary credentials are useful in the following situations: • Federated user access – To assign permissions to a federated identity, you create a role and define permissions for the role. When a federated identity authenticates, the identity Authenticating with identities Version 1.0 94 AWS Certificate Manager User Guide is associated with the role and is granted the permissions that are defined by the role. For information about roles for federation, see Create a role for a third-party identity provider (federation) in the IAM User Guide. If you use IAM Identity Center, you configure a permission set. To control what your identities can access after they authenticate, IAM Identity Center correlates the permission set to a role in IAM. For information about permissions sets, see Permission sets in the AWS IAM Identity Center User Guide. • Temporary IAM user permissions – An IAM user or role can assume an IAM role to temporarily take on different permissions for a specific task. • Cross-account access – You can use an IAM role to allow someone (a trusted principal) in a different account to access resources in your account. Roles are the primary way to grant cross- account access. However, with some AWS services, you can attach a policy directly to a resource (instead of using a role as a proxy). To learn the difference between roles and resource-based policies for cross-account access, see Cross account resource access in IAM in the IAM User Guide. • Cross-service access – Some AWS services use features in other AWS services. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3. A service might do this using the calling principal's permissions, using a service role, or using a service-linked role. • Forward access sessions (FAS) – When you use an IAM user or role to perform actions in AWS, you are considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. FAS uses the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other AWS services or resources to complete. In this case, you must have permissions to perform both actions. For policy details when making FAS requests, see Forward access sessions. • Service role – A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Create a role to delegate permissions to an AWS service in the IAM User Guide. • Service-linked role – A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. • Applications running on Amazon EC2 – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API Authenticating with identities Version 1.0 95 AWS Certificate Manager User Guide requests. This is preferable to storing access keys within the EC2 |
acm-ug-038 | acm-ug.pdf | 38 | is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. • Applications running on Amazon EC2 – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API Authenticating with identities Version 1.0 95 AWS Certificate Manager User Guide requests. This is preferable to storing access keys within the EC2 instance. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials. For more information, see Use an IAM role to grant permissions to applications running on Amazon EC2 instances in the IAM User Guide. Managing access using policies You control access in AWS by creating policies and attaching them to AWS identities or resources. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions. AWS evaluates these policies when a principal (user, root user, or role session) makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in AWS as JSON documents. For more information about the structure and contents of JSON policy documents, see Overview of JSON policies in the IAM User Guide. Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. By default, users and roles have no permissions. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles. IAM policies define permissions for an action regardless of the method that you use to perform the operation. For example, suppose that you have a policy that allows the iam:GetRole action. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API. Identity-based policies Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Define custom IAM permissions with customer managed policies in the IAM User Guide. Identity-based policies can be further categorized as inline policies or managed policies. Inline policies are embedded directly into a single user, group, or role. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account. Managed policies include AWS managed policies and customer managed policies. To learn how to choose Managing access using policies Version 1.0 96 AWS Certificate Manager User Guide between a managed policy or an inline policy, see Choose between managed policies and inline policies in the IAM User Guide. Resource-based policies Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM role trust policies and Amazon S3 bucket policies. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must specify a principal in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services. Resource-based policies are inline policies that are located in that service. You can't use AWS managed policies from IAM in a resource-based policy. Access control lists (ACLs) Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format. Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs. To learn more about ACLs, see Access control list (ACL) overview in the Amazon Simple Storage Service Developer Guide. Other policy types AWS supports additional, less-common policy types. These policy types can set the maximum permissions granted to you by the more common policy types. • Permissions boundaries – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to an IAM entity (IAM user or role). You can set a permissions boundary for an |
acm-ug-039 | acm-ug.pdf | 39 | format. Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs. To learn more about ACLs, see Access control list (ACL) overview in the Amazon Simple Storage Service Developer Guide. Other policy types AWS supports additional, less-common policy types. These policy types can set the maximum permissions granted to you by the more common policy types. • Permissions boundaries – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to an IAM entity (IAM user or role). You can set a permissions boundary for an entity. The resulting permissions are the intersection of an entity's identity-based policies and its permissions boundaries. Resource-based policies that specify the user or role in the Principal field are not limited by the permissions boundary. An explicit deny in any of these policies overrides the allow. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM User Guide. • Service control policies (SCPs) – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit (OU) in AWS Organizations. AWS Organizations is a Managing access using policies Version 1.0 97 AWS Certificate Manager User Guide service for grouping and centrally managing multiple AWS accounts that your business owns. If you enable all features in an organization, then you can apply service control policies (SCPs) to any or all of your accounts. The SCP limits permissions for entities in member accounts, including each AWS account root user. For more information about Organizations and SCPs, see Service control policies in the AWS Organizations User Guide. • Resource control policies (RCPs) – RCPs are JSON policies that you can use to set the maximum available permissions for resources in your accounts without updating the IAM policies attached to each resource that you own. The RCP limits permissions for resources in member accounts and can impact the effective permissions for identities, including the AWS account root user, regardless of whether they belong to your organization. For more information about Organizations and RCPs, including a list of AWS services that support RCPs, see Resource control policies (RCPs) in the AWS Organizations User Guide. • Session policies – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user. The resulting session's permissions are the intersection of the user or role's identity-based policies and the session policies. Permissions can also come from a resource-based policy. An explicit deny in any of these policies overrides the allow. For more information, see Session policies in the IAM User Guide. Multiple policy types When multiple types of policies apply to a request, the resulting permissions are more complicated to understand. To learn how AWS determines whether to allow a request when multiple policy types are involved, see Policy evaluation logic in the IAM User Guide. How AWS Certificate Manager works with IAM Before you use IAM to manage access to ACM, learn what IAM features are available to use with ACM. IAM features you can use with AWS Certificate Manager IAM feature ACM support Identity-based policies Resource-based policies Yes No How AWS Certificate Manager works with IAM Version 1.0 98 User Guide AWS Certificate Manager IAM feature Policy actions Policy resources Policy condition keys (service-specific) ACLs ACM support Yes Yes Yes No ABAC (tags in policies) Partial Temporary credentials Principal permissions Service roles Service-linked roles Yes Yes No Yes To get a high-level view of how ACM and other AWS services work with most IAM features, see AWS services that work with IAM in the IAM User Guide. Identity-based policies for ACM Supports identity-based policies: Yes Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Define custom IAM permissions with customer managed policies in the IAM User Guide. With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. You can't specify the principal in an identity-based policy because it applies to the user or role to which it is attached. To learn about all of the elements that you can use in a JSON policy, see IAM JSON policy elements reference in the IAM User Guide. Identity-based policy examples for ACM How AWS Certificate Manager works with IAM Version 1.0 99 AWS Certificate Manager User Guide To view examples of ACM identity-based policies, see Identity-based policy examples for AWS Certificate Manager. Resource-based policies within ACM Supports resource-based policies: No Resource-based policies |
acm-ug-040 | acm-ug.pdf | 40 | under which actions are allowed or denied. You can't specify the principal in an identity-based policy because it applies to the user or role to which it is attached. To learn about all of the elements that you can use in a JSON policy, see IAM JSON policy elements reference in the IAM User Guide. Identity-based policy examples for ACM How AWS Certificate Manager works with IAM Version 1.0 99 AWS Certificate Manager User Guide To view examples of ACM identity-based policies, see Identity-based policy examples for AWS Certificate Manager. Resource-based policies within ACM Supports resource-based policies: No Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM role trust policies and Amazon S3 bucket policies. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must specify a principal in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services. To enable cross-account access, you can specify an entire account or IAM entities in another account as the principal in a resource-based policy. Adding a cross-account principal to a resource- based policy is only half of establishing the trust relationship. When the principal and the resource are in different AWS accounts, an IAM administrator in the trusted account must also grant the principal entity (user or role) permission to access the resource. They grant permission by attaching an identity-based policy to the entity. However, if a resource-based policy grants access to a principal in the same account, no additional identity-based policy is required. For more information, see Cross account resource access in IAM in the IAM User Guide. Policy actions for ACM Supports policy actions: Yes Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Action element of a JSON policy describes the actions that you can use to allow or deny access in a policy. Policy actions usually have the same name as the associated AWS API operation. There are some exceptions, such as permission-only actions that don't have a matching API operation. There are also some operations that require multiple actions in a policy. These additional actions are called dependent actions. Include actions in a policy to grant permissions to perform the associated operation. How AWS Certificate Manager works with IAM Version 1.0 100 AWS Certificate Manager User Guide To see a list of ACM actions, see Actions defined by AWS Certificate Manager in the Service Authorization Reference. Policy actions in ACM use the following prefix before the action: acm To specify multiple actions in a single statement, separate them with commas. "Action": [ "acm:action1", "acm:action2" ] To view examples of ACM identity-based policies, see Identity-based policy examples for AWS Certificate Manager. Policy resources for ACM Supports policy resources: Yes Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Resource JSON policy element specifies the object or objects to which the action applies. Statements must include either a Resource or a NotResource element. As a best practice, specify a resource using its Amazon Resource Name (ARN). You can do this for actions that support a specific resource type, known as resource-level permissions. For actions that don't support resource-level permissions, such as listing operations, use a wildcard (*) to indicate that the statement applies to all resources. "Resource": "*" To see a list of ACM resource types and their ARNs, see Resources defined by AWS Certificate Manager in the Service Authorization Reference. To learn with which actions you can specify the ARN of each resource, see Actions defined by AWS Certificate Manager. How AWS Certificate Manager works with IAM Version 1.0 101 AWS Certificate Manager User Guide To view examples of ACM identity-based policies, see Identity-based policy examples for AWS Certificate Manager. Policy condition keys for ACM Supports service-specific policy condition keys: Yes Administrators can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Condition element (or Condition block) lets you specify conditions in which a statement is in effect. The Condition element is optional. You can create conditional expressions that use condition operators, such as equals or less than, to match the condition in the policy with values in the request. If you specify multiple Condition elements in a statement, or multiple keys in a single Condition element, AWS evaluates them using a logical AND operation. |
acm-ug-041 | acm-ug.pdf | 41 | can use AWS JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions. The Condition element (or Condition block) lets you specify conditions in which a statement is in effect. The Condition element is optional. You can create conditional expressions that use condition operators, such as equals or less than, to match the condition in the policy with values in the request. If you specify multiple Condition elements in a statement, or multiple keys in a single Condition element, AWS evaluates them using a logical AND operation. If you specify multiple values for a single condition key, AWS evaluates the condition using a logical OR operation. All of the conditions must be met before the statement's permissions are granted. You can also use placeholder variables when you specify conditions. For example, you can grant an IAM user permission to access a resource only if it is tagged with their IAM user name. For more information, see IAM policy elements: variables and tags in the IAM User Guide. AWS supports global condition keys and service-specific condition keys. To see all AWS global condition keys, see AWS global condition context keys in the IAM User Guide. To see a list of ACM condition keys, see Condition keys for AWS Certificate Manager in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions defined by AWS Certificate Manager. To view examples of ACM identity-based policies, see Identity-based policy examples for AWS Certificate Manager. ACLs in ACM Supports ACLs: No Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format. How AWS Certificate Manager works with IAM Version 1.0 102 AWS Certificate Manager ABAC with ACM Supports ABAC (tags in policies): Partial User Guide Attribute-based access control (ABAC) is an authorization strategy that defines permissions based on attributes. In AWS, these attributes are called tags. You can attach tags to IAM entities (users or roles) and to many AWS resources. Tagging entities and resources is the first step of ABAC. Then you design ABAC policies to allow operations when the principal's tag matches the tag on the resource that they are trying to access. ABAC is helpful in environments that are growing rapidly and helps with situations where policy management becomes cumbersome. To control access based on tags, you provide tag information in the condition element of a policy using the aws:ResourceTag/key-name, aws:RequestTag/key-name, or aws:TagKeys condition keys. If a service supports all three condition keys for every resource type, then the value is Yes for the service. If a service supports all three condition keys for only some resource types, then the value is Partial. For more information about ABAC, see Define permissions with ABAC authorization in the IAM User Guide. To view a tutorial with steps for setting up ABAC, see Use attribute-based access control (ABAC) in the IAM User Guide. Using temporary credentials with ACM Supports temporary credentials: Yes Some AWS services don't work when you sign in using temporary credentials. For additional information, including which AWS services work with temporary credentials, see AWS services that work with IAM in the IAM User Guide. You are using temporary credentials if you sign in to the AWS Management Console using any method except a user name and password. For example, when you access AWS using your company's single sign-on (SSO) link, that process automatically creates temporary credentials. You also automatically create temporary credentials when you sign in to the console as a user and then switch roles. For more information about switching roles, see Switch from a user to an IAM role (console) in the IAM User Guide. How AWS Certificate Manager works with IAM Version 1.0 103 AWS Certificate Manager User Guide You can manually create temporary credentials using the AWS CLI or AWS API. You can then use those temporary credentials to access AWS. AWS recommends that you dynamically generate temporary credentials instead of using long-term access keys. For more information, see Temporary security credentials in IAM. Cross-service principal permissions for ACM Supports forward access sessions (FAS): Yes When you use an IAM user or role to perform actions in AWS, you are considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. FAS uses the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other AWS services or resources to complete. In this case, you must |
acm-ug-042 | acm-ug.pdf | 42 | in IAM. Cross-service principal permissions for ACM Supports forward access sessions (FAS): Yes When you use an IAM user or role to perform actions in AWS, you are considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. FAS uses the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other AWS services or resources to complete. In this case, you must have permissions to perform both actions. For policy details when making FAS requests, see Forward access sessions. Service roles for ACM Supports service roles: No A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Create a role to delegate permissions to an AWS service in the IAM User Guide. Warning Changing the permissions for a service role might break ACM functionality. Edit service roles only when ACM provides guidance to do so. Service-linked roles for ACM Supports service-linked roles: Yes A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. How AWS Certificate Manager works with IAM Version 1.0 104 AWS Certificate Manager User Guide For details about creating or managing service-linked roles, see AWS services that work with IAM. Find a service in the table that includes a Yes in the Service-linked role column. Choose the Yes link to view the service-linked role documentation for that service. Identity-based policy examples for AWS Certificate Manager By default, users and roles don't have permission to create or modify ACM resources. They also can't perform tasks by using the AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS API. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles. To learn how to create an IAM identity-based policy by using these example JSON policy documents, see Create IAM policies (console) in the IAM User Guide. For details about actions and resource types defined by ACM, including the format of the ARNs for each of the resource types, see Actions, resources, and condition keys for AWS Certificate Manager in the Service Authorization Reference. Topics • Policy best practices • Using the ACM console • Allow users to view their own permissions • Listing certificates • Retrieving a certificate • Importing a certificate • Deleting a certificate Policy best practices Identity-based policies determine whether someone can create, access, or delete ACM resources in your account. These actions can incur costs for your AWS account. When you create or edit identity- based policies, follow these guidelines and recommendations: • Get started with AWS managed policies and move toward least-privilege permissions – To get started granting permissions to your users and workloads, use the AWS managed policies that grant permissions for many common use cases. They are available in your AWS account. We Identity-based policy examples Version 1.0 105 AWS Certificate Manager User Guide recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see AWS managed policies or AWS managed policies for job functions in the IAM User Guide. • Apply least-privilege permissions – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as least-privilege permissions. For more information about using IAM to apply permissions, see Policies and permissions in IAM in the IAM User Guide. • Use conditions in IAM policies to further restrict access – You can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation. For more information, see IAM JSON policy elements: Condition in the IAM User Guide. • Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions – IAM Access Analyzer validates new and existing policies so that the policies adhere |
acm-ug-043 | acm-ug.pdf | 43 | can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation. For more information, see IAM JSON policy elements: Condition in the IAM User Guide. • Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language (JSON) and IAM best practices. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies. For more information, see Validate policies with IAM Access Analyzer in the IAM User Guide. • Require multi-factor authentication (MFA) – If you have a scenario that requires IAM users or a root user in your AWS account, turn on MFA for additional security. To require MFA when API operations are called, add MFA conditions to your policies. For more information, see Secure API access with MFA in the IAM User Guide. For more information about best practices in IAM, see Security best practices in IAM in the IAM User Guide. Using the ACM console To access the AWS Certificate Manager console, you must have a minimum set of permissions. These permissions must allow you to list and view details about the ACM resources in your AWS account. If you create an identity-based policy that is more restrictive than the minimum required permissions, the console won't function as intended for entities (users or roles) with that policy. You don't need to allow minimum console permissions for users that are making calls only to the AWS CLI or the AWS API. Instead, allow access to only the actions that match the API operation that they're trying to perform. Identity-based policy examples Version 1.0 106 AWS Certificate Manager User Guide To ensure that users and roles can still use the ACM console, also attach the ACM AWSCertificateManagerReadOnly AWS managed policy to the entities. For more information, see Adding permissions to a user in the IAM User Guide. Allow users to view their own permissions This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API. { "Version": "2012-10-17", "Statement": [ { "Sid": "ViewOwnUserInfo", "Effect": "Allow", "Action": [ "iam:GetUserPolicy", "iam:ListGroupsForUser", "iam:ListAttachedUserPolicies", "iam:ListUserPolicies", "iam:GetUser" ], "Resource": ["arn:aws:iam::*:user/${aws:username}"] }, { "Sid": "NavigateInConsole", "Effect": "Allow", "Action": [ "iam:GetGroupPolicy", "iam:GetPolicyVersion", "iam:GetPolicy", "iam:ListAttachedGroupPolicies", "iam:ListGroupPolicies", "iam:ListPolicyVersions", "iam:ListPolicies", "iam:ListUsers" ], "Resource": "*" } ] } Identity-based policy examples Version 1.0 107 AWS Certificate Manager Listing certificates User Guide The following policy allows a user to list all of the ACM certificates in the user's account. { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":"acm:ListCertificates", "Resource":"*" } ] } Note This permission is required for ACM certificates to appear in the Elastic Load Balancing and CloudFront consoles. Retrieving a certificate The following policy allows a user to retrieve a specific ACM certificate. { "Version":"2012-10-17", "Statement":{ "Effect":"Allow", "Action":"acm:GetCertificate", "Resource":"arn:aws:acm:region:account:certificate/certificate_ID" } } Importing a certificate The following policy allows a user to import a certificate. { "Version":"2012-10-17", Identity-based policy examples Version 1.0 108 AWS Certificate Manager User Guide "Statement":{ "Effect":"Allow", "Action":"acm:ImportCertificate", "Resource":"arn:aws:acm:region:account:certificate/certificate_ID" } } Deleting a certificate The following policy allows a user to delete a specific ACM certificate. { "Version":"2012-10-17", "Statement":{ "Effect":"Allow", "Action":"acm:DeleteCertificate", "Resource":"arn:aws:acm:region:account:certificate/certificate_ID" } } ACM API permissions: Actions and resources reference When you set up access control and write permissions policies that you can attach to an IAM user or role, you can use the following table as a reference. The first column in the table lists each AWS Certificate Manager API operation. You specify actions in a policy's Action element. The remaining columns provide the additional information: You can use the IAM policy elements in your ACM policies to express conditions. For a complete list, see Available Keys in the IAM User Guide. Note To specify an action, use the acm: prefix followed by the API operation name (for example, acm:RequestCertificate). ACM API permissions reference Version 1.0 109 AWS Certificate Manager User Guide ACM API operations and permissions ACM API Operations Required Permissions (API Operations) Resources AddTagsToCertificate acm:AddTagsToCerti arn:aws:a ficate cm: region:account:certific ate/ certificate_ID DeleteCertificate acm:DeleteCertific arn:aws:a ate cm: region:account:certific ate/ certificate_ID DescribeCertificate acm:DescribeCertif arn:aws:a icate cm: region:account:certific ate/ certificate_ID ExportCertificate acm:ExportCertific arn:aws:a ate cm: region:account:certific ate/ certificate_ID GetAccountConfiguration acm:GetAccountConf * iguration GetCertificate acm:GetCertificate arn:aws:a cm: region:account:certific ate/ certificate_ID ImportCertificate acm:ImportCertific arn:aws:a ate cm: region:account:certific ListCertificates acm:ListCertificates ate/* or * * ACM API permissions reference Version |
acm-ug-044 | acm-ug.pdf | 44 | an action, use the acm: prefix followed by the API operation name (for example, acm:RequestCertificate). ACM API permissions reference Version 1.0 109 AWS Certificate Manager User Guide ACM API operations and permissions ACM API Operations Required Permissions (API Operations) Resources AddTagsToCertificate acm:AddTagsToCerti arn:aws:a ficate cm: region:account:certific ate/ certificate_ID DeleteCertificate acm:DeleteCertific arn:aws:a ate cm: region:account:certific ate/ certificate_ID DescribeCertificate acm:DescribeCertif arn:aws:a icate cm: region:account:certific ate/ certificate_ID ExportCertificate acm:ExportCertific arn:aws:a ate cm: region:account:certific ate/ certificate_ID GetAccountConfiguration acm:GetAccountConf * iguration GetCertificate acm:GetCertificate arn:aws:a cm: region:account:certific ate/ certificate_ID ImportCertificate acm:ImportCertific arn:aws:a ate cm: region:account:certific ListCertificates acm:ListCertificates ate/* or * * ACM API permissions reference Version 1.0 110 AWS Certificate Manager ACM API Operations Required Permissions (API Operations) Resources User Guide ListTagsForCertificate acm:ListTagsForCer arn:aws:a tificate cm: region:account:certific ate/ certificate_ID PutAccountConfiguration acm:PutAccountConf * iguration RemoveTagsFromCertificate acm:RemoveTagsFrom arn:aws:a Certificate cm: region:account:certific ate/ certificate_ID RequestCertificate acm:RequestCertifi arn:aws:a cate cm: region:account:certific ate/* or * ResendValidationEmail acm:ResendValidati arn:aws:a onEmail cm: region:account:certific ate/ certificate_ID UpdateCertificateOptions acm:UpdateCertific arn:aws:a ateOptions cm: region:account:certific ate/ certificate_ID AWS managed policies for AWS Certificate Manager An AWS managed policy is a standalone policy that is created and administered by AWS. AWS managed policies are designed to provide permissions for many common use cases so that you can start assigning permissions to users, groups, and roles. AWS managed policies Version 1.0 111 AWS Certificate Manager User Guide Keep in mind that AWS managed policies might not grant least-privilege permissions for your specific use cases because they're available for all AWS customers to use. We recommend that you reduce permissions further by defining customer managed policies that are specific to your use cases. You cannot change the permissions defined in AWS managed policies. If AWS updates the permissions defined in an AWS managed policy, the update affects all principal identities (users, groups, and roles) that the policy is attached to. AWS is most likely to update an AWS managed policy when a new AWS service is launched or new API operations become available for existing services. For more information, see AWS managed policies in the IAM User Guide. AWSCertificateManagerReadOnly This policy provides read–only access to ACM certificates; it allows users to describe, list, and retrieve ACM certificates. { "Version":"2012-10-17", "Statement":{ "Effect":"Allow", "Action":[ "acm:DescribeCertificate", "acm:ListCertificates", "acm:GetCertificate", "acm:ListTagsForCertificate", "acm:GetAccountConfiguration" ], "Resource":"*" } } To view this AWS managed policy in the console, go to https://console.aws.amazon.com/iam/ home#policies/arn:aws:iam::aws:policy/AWSCertificateManagerReadOnly. AWS managed policies Version 1.0 112 AWS Certificate Manager User Guide AWSCertificateManagerFullAccess This policy provides full access to all ACM actions and resources. { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "acm:*" ], "Resource":"*" }, { "Effect":"Allow", "Action":"iam:CreateServiceLinkedRole", "Resource":"arn:aws:iam::*:role/aws-service-role/acm.amazonaws.com/ AWSServiceRoleForCertificateManager*", "Condition":{ "StringEquals":{ "iam:AWSServiceName":"acm.amazonaws.com" } } }, { "Effect":"Allow", "Action":[ "iam:DeleteServiceLinkedRole", "iam:GetServiceLinkedRoleDeletionStatus", "iam:GetRole" ], "Resource":"arn:aws:iam::*:role/aws-service-role/acm.amazonaws.com/ AWSServiceRoleForCertificateManager*" } ] } To view this AWS managed policy in the console, go to https://console.aws.amazon.com/iam/ home#policies/arn:aws:iam::aws:policy/AWSCertificateManagerFullAccess. AWS managed policies Version 1.0 113 AWS Certificate Manager User Guide ACM updates to AWS managed policies View details about updates to AWS managed policies for ACM since this service began tracking these changes. For automatic alerts about changes to this page, subscribe to the RSS feed on the ACM Document history page. Change Description Date Added GetAccoun tConfiguration support to the AWSCertificateMana gerReadOnly policy. The AWSCertificateMana gerReadOnly policy now includes permission to call the GetAccountConfigur ation API action. March 3, 2021 ACM starts tracking changes ACM starts tracking changes for AWS managed policies. March 3, 2021 Use condition keys with ACM AWS Certificate Manager uses AWS Identity and Access Management (IAM) condition keys to limit access to certificate requests. With condition keys from IAM policies or Service Control Policies (SCP) you can create certificate requests that conform to your organization's guidelines. Note Combine ACM condition keys with AWS global condition keys such as aws:PrincipalArn to further restrict actions to specific users or roles. Use condition keys Version 1.0 114 AWS Certificate Manager User Guide Supported conditions for ACM ACM API operations and supported conditions Condition Key acm:Valid ationMethod Supported ACM API Operations Type Description RequestCertificate String (DNS, EMAIL, HTTP) Filter requests based on ACM validation acm:DomainNames RequestCertificate ArrayOfString acm:KeyAl gorithm acm:Certi ficateTra nsparency Logging acm:Certi ficateAut hority RequestCertificate String RequestCertificate String (ENABLED, DISABLED) RequestCertificate ARN method Filter based on domain names in the ACM request Filter requests based on ACM key algorithm and size Filter requests based on ACM certificate transparency logging preference Filter requests based on certifica te authorities in the ACM request Example 1: Restricting validation method The following policy denies new certificate requests using the Email Validation method except for a request made using the arn:aws:iam::123456789012:role/AllowedEmailValidation role. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", Use condition keys Version 1.0 115 AWS Certificate Manager User Guide "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "StringLike" : { "acm:ValidationMethod":"EMAIL" }, "ArnNotLike": { "aws:PrincipalArn": [ "arn:aws:iam::123456789012:role/ AllowedEmailValidation"] } } } } Example 2: Preventing wildcard domains The following policy denies any new ACM certificate request that uses wildcard domains. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", |
acm-ug-045 | acm-ug.pdf | 45 | based on ACM certificate transparency logging preference Filter requests based on certifica te authorities in the ACM request Example 1: Restricting validation method The following policy denies new certificate requests using the Email Validation method except for a request made using the arn:aws:iam::123456789012:role/AllowedEmailValidation role. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", Use condition keys Version 1.0 115 AWS Certificate Manager User Guide "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "StringLike" : { "acm:ValidationMethod":"EMAIL" }, "ArnNotLike": { "aws:PrincipalArn": [ "arn:aws:iam::123456789012:role/ AllowedEmailValidation"] } } } } Example 2: Preventing wildcard domains The following policy denies any new ACM certificate request that uses wildcard domains. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition": { "ForAnyValue:StringLike": { "acm:DomainNames": [ "${*}.*" ] } } } } Example 3: Restricting certificate domains The following policy denies any new ACM certificate request for domains that don't end with *.amazonaws.com Use condition keys Version 1.0 116 User Guide AWS Certificate Manager { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition": { "ForAnyValue:StringNotLike": { "acm:DomainNames": ["*.amazonaws.com"] } } } } The policy could be further restricted to specific subdomains. This policy would only allow requests where every domain matches at least one of the conditional domain names. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition": { "ForAllValues:StringNotLike": { "acm:DomainNames": ["support.amazonaws.com", "developer.amazonaws.com"] } } } } Example 4: Restricting key algorithm The following policy uses the condition key StringNotLike to allow only certificates requested with the ECDSA 384 bit (EC_secp384r1) key algorithm. { "Version":"2012-10-17", Use condition keys Version 1.0 117 User Guide AWS Certificate Manager "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "StringNotLike" : { "acm:KeyAlgorithm":"EC_secp384r1" } } } } The following policy uses the condition key StringLike and wildcard * matching to prevent requests for new certificates in ACM with any RSA key algorithm. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "StringLike" : { "acm:KeyAlgorithm":"RSA*" } } } } Example 5: Restricting certificate authority The following policy would only allow requests for private certificates using the provided Private Certificate Authority (PCA) ARN. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", Use condition keys Version 1.0 118 AWS Certificate Manager User Guide "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "StringNotLike": { "acm:CertificateAuthority":" arn:aws:acm- pca:region:account:certificate-authority/CA_ID" } } } } This policy uses the acm:CertificateAuthority condition to allow only requests for publicly trusted certificates issued by Amazon Trust Services. Setting the Certificate Authority ARN to false prevents requests for private certificates from PCA. { "Version":"2012-10-17", "Statement":{ "Effect":"Deny", "Action":"acm:RequestCertificate", "Resource":"*", "Condition":{ "Null" : { "acm:CertificateAuthority":"false" } } } } Use a service-linked role (SLR) with ACM AWS Certificate Manager uses an AWS Identity and Access Management (IAM) service-linked role to enable enable automatic renewals of private certificates issued from a private CA for another account shared by AWS Resource Access Manager. A service-linked role (SLR) is an IAM role that is linked directly to the ACM service. SLRs are predefined by ACM and include all the permissions that the service requires to call other AWS services on your behalf. Use service-linked roles Version 1.0 119 AWS Certificate Manager User Guide The SLR makes setting up ACM easier because you don’t have to manually add the necessary permissions for unattended certificate signing. ACM defines the permissions of its SLR, and unless defined otherwise, only ACM can assume the role. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity. For information about other services that support SLRs, see AWS Services That Work with IAM and look for the services that have Yes in the Service-Linked Role column. Choose a Yes with a link to view the SLR documentation for that service. SLR permissions for ACM ACM uses an SLR named Amazon Certificate Manager Service Role Policy. The AWSServiceRoleForCertificateManager SLR trusts the following services to assume the role: • acm.amazonaws.com The role permissions policy allows ACM to complete the following actions on the specified resources: • Actions: acm-pca:IssueCertificate, acm-pca:GetCertificate on "*" You must configure permissions to allow an IAM entity (such as a user, group, or role) to create, edit, or delete an SLR. For more information, see Service-Linked Role Permissions in the IAM User Guide. Important ACM might alert you that it cannot determine whether an SLR exists on your account. If the required iam:GetRole permission has already been granted to the ACM SLR for your account, then the alert will not recur after the SLR is created. If it does recur, then you or your account administrator might need to grant the iam:GetRole permission to ACM, or associate your account with the ACM-managed policy AWSCertificateManagerFullAccess. Use service-linked roles Version 1.0 120 AWS Certificate Manager Creating the SLR for ACM User Guide You don't need to manually create the SLR that ACM uses. When you issue an ACM certificate using the AWS Management Console, the AWS CLI, or the AWS API, ACM creates the SLR for you the first time that you |
acm-ug-046 | acm-ug.pdf | 46 | ACM SLR for your account, then the alert will not recur after the SLR is created. If it does recur, then you or your account administrator might need to grant the iam:GetRole permission to ACM, or associate your account with the ACM-managed policy AWSCertificateManagerFullAccess. Use service-linked roles Version 1.0 120 AWS Certificate Manager Creating the SLR for ACM User Guide You don't need to manually create the SLR that ACM uses. When you issue an ACM certificate using the AWS Management Console, the AWS CLI, or the AWS API, ACM creates the SLR for you the first time that you a private CA for another account shared by AWS RAM to sign your certificate. If you encounter messages stating that ACM cannot determine whether an SLR exists on your account, it may mean that your account has not granted a read permission that AWS Private CA requires. This will not prevent the SLR from being installed, and you can still issue certificates, but ACM will be unable to renew the certificates automatically until you resolve the problem. For more information, see Problems with the ACM service-linked role (SLR). Important This SLR can appear in your account if you completed an action in another service that uses the features supported by this role. Also, if you were using the ACM service before January 1, 2017, when it began supporting SLRs, then ACM created the AWSServiceRoleForCertificateManager role in your account. To learn more, see A New Role Appeared in My IAM Account. If you delete this SLR, and then need to create it again, you can use either of these methods: • In the IAM console, choose Role, Create role, Certificate Manager to create a new role with the CertificateManagerServiceRolePolicy use case. • Using the IAM API CreateServiceLinkedRole or the corresponding AWS CLI command create- service-linked-role, create an SLR with the acm.amazonaws.com service name. For more information, see Creating a Service-Linked Role in the IAM User Guide. Editing the SLR for ACM ACM does not allow you to edit the AWSServiceRoleForCertificateManager service-linked role. After you create an SLR, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see Editing a Service-Linked Role in the IAM User Guide. Use service-linked roles Version 1.0 121 AWS Certificate Manager Deleting the SLR for ACM User Guide You typically don't need to delete the AWSServiceRoleForCertificateManager SLR. However, you can delete the role manually using the IAM console, the AWS CLI or the AWS API. For more information, see Deleting a Service-Linked Role in the IAM User Guide. Supported Regions for ACM SLRs ACM supports using SLRs in all of the regions where both ACM and AWS Private CA are available. For more information, see AWS Regions and Endpoints. Region name Region identity Support in ACM US East (N. Virginia) US East (Ohio) US West (N. California) US West (Oregon) Asia Pacific (Mumbai) Asia Pacific (Osaka) Asia Pacific (Seoul) Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Canada (Central) Europe (Frankfurt) Europe (Zurich) Europe (Ireland) Europe (London) us-east-1 us-east-2 us-west-1 us-west-2 ap-south-1 ap-northeast-3 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 eu-central-1 eu-central-2 eu-west-1 eu-west-2 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Use service-linked roles Version 1.0 122 AWS Certificate Manager Region name Europe (Paris) South America (São Paulo) Region identity Support in ACM User Guide eu-west-3 sa-east-1 AWS GovCloud (US-West) us-gov-west-1 AWS GovCloud (US-East) East us-gov-east-1 Yes Yes Yes Yes Troubleshooting AWS Certificate Manager identity and access Use the following information to help you diagnose and fix common issues that you might encounter when working with ACM and IAM. Topics • I am not authorized to perform an action in ACM • I am not authorized to request a certificate in ACM • I am not authorized to perform iam:PassRole • I want to allow people outside of my AWS account to access my ACM resources I am not authorized to perform an action in ACM If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action. The following example error occurs when the mateojackson IAM user tries to use the console to view details about a fictional my-example-widget resource but doesn't have the fictional acm:GetWidget permissions. User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: acm:GetWidget on resource: my-example-widget In this case, the policy for the mateojackson user must be updated to allow access to the my- example-widget resource by using the acm:GetWidget action. If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials. Troubleshooting Version 1.0 123 AWS Certificate Manager User Guide I am not authorized |
acm-ug-047 | acm-ug.pdf | 47 | action. The following example error occurs when the mateojackson IAM user tries to use the console to view details about a fictional my-example-widget resource but doesn't have the fictional acm:GetWidget permissions. User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: acm:GetWidget on resource: my-example-widget In this case, the policy for the mateojackson user must be updated to allow access to the my- example-widget resource by using the acm:GetWidget action. If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials. Troubleshooting Version 1.0 123 AWS Certificate Manager User Guide I am not authorized to request a certificate in ACM If you receive this error, your ACM or PKI administrator has set rules that prevent you from requesting the certificate in its current state. The following example error occurs when an IAM user tries to use the console to request a certificate using options that are configured with a DENY by the organization administrator. User: arn:aws:sts::account::ID: is not authorized to perform: acm:RequestCertificate on resource: arn:aws:acm:region:account:certificate/* with an explicit deny in a service control policy In this case the request should be made again in a way that is inline with the policies set by your administrator. Or the policy needs to be updated to allow requesting the certificate. I am not authorized to perform iam:PassRole If you receive an error that you're not authorized to perform the iam:PassRole action, your policies must be updated to allow you to pass a role to ACM. Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service. The following example error occurs when an IAM user named marymajor tries to use the console to perform an action in ACM. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service. User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole In this case, Mary's policies must be updated to allow her to perform the iam:PassRole action. If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials. I want to allow people outside of my AWS account to access my ACM resources You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support Troubleshooting Version 1.0 124 AWS Certificate Manager User Guide resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources. To learn more, consult the following: • To learn whether ACM supports these features, see How AWS Certificate Manager works with IAM. • To learn how to provide access to your resources across AWS accounts that you own, see Providing access to an IAM user in another AWS account that you own in the IAM User Guide. • To learn how to provide access to your resources to third-party AWS accounts, see Providing access to AWS accounts owned by third parties in the IAM User Guide. • To learn how to provide access through identity federation, see Providing access to externally authenticated users (identity federation) in the IAM User Guide. • To learn the difference between using roles and resource-based policies for cross-account access, see Cross account resource access in IAM in the IAM User Guide. Resilience in AWS Certificate Manager The AWS global infrastructure is built around AWS Regions and Availability Zones. AWS Regions provide multiple physically separated and isolated Availability Zones, which are connected with low-latency, high-throughput, and highly redundant networking. With Availability Zones, you can design and operate applications and databases that automatically fail over between zones without interruption. Availability Zones are more highly available, fault tolerant, and scalable than traditional single or multiple data center infrastructures. For more information about AWS Regions and Availability Zones, see AWS Global Infrastructure. Infrastructure security in AWS Certificate Manager As a managed service, AWS Certificate Manager is protected by AWS global network security. For information about AWS security services and how AWS protects infrastructure, see AWS Cloud Security. To design your AWS environment using the best practices for infrastructure security, see Infrastructure Protection in Security Pillar AWS Well‐Architected Framework. You use AWS published API calls to access ACM through the network. Clients must support the following: Resilience Version 1.0 125 AWS Certificate Manager User Guide • Transport Layer Security (TLS). We require TLS 1.2 and recommend TLS 1.3. • Cipher suites with perfect forward secrecy (PFS) such as DHE (Ephemeral Diffie-Hellman) or ECDHE (Elliptic Curve Ephemeral Diffie-Hellman). Most modern systems such |
acm-ug-048 | acm-ug.pdf | 48 | network security. For information about AWS security services and how AWS protects infrastructure, see AWS Cloud Security. To design your AWS environment using the best practices for infrastructure security, see Infrastructure Protection in Security Pillar AWS Well‐Architected Framework. You use AWS published API calls to access ACM through the network. Clients must support the following: Resilience Version 1.0 125 AWS Certificate Manager User Guide • Transport Layer Security (TLS). We require TLS 1.2 and recommend TLS 1.3. • Cipher suites with perfect forward secrecy (PFS) such as DHE (Ephemeral Diffie-Hellman) or ECDHE (Elliptic Curve Ephemeral Diffie-Hellman). Most modern systems such as Java 7 and later support these modes. Additionally, requests must be signed by using an access key ID and a secret access key that is associated with an IAM principal. Or you can use the AWS Security Token Service (AWS STS) to generate temporary security credentials to sign requests. Granting programmative access to ACM Users need programmatic access if they want to interact with AWS outside of the AWS Management Console. The way to grant programmatic access depends on the type of user that's accessing AWS. To grant users programmatic access, choose one of the following options. Which user needs programmatic access? To By Workforce identity (Users managed in IAM Identity Center) Use temporary credentials to sign programmatic requests Following the instructions for the interface that you want to to the AWS CLI, AWS SDKs, or use. AWS APIs. • For the AWS CLI, see Configuring the AWS CLI to use AWS IAM Identity Center in the AWS Command Line Interface User Guide. • For AWS SDKs, tools, and AWS APIs, see IAM Identity Center authentication in the AWS SDKs and Tools Reference Guide. IAM Use temporary credentials to sign programmatic requests Following the instructions in Using temporary credentia Granting programmative access to ACM Version 1.0 126 AWS Certificate Manager User Guide Which user needs programmatic access? To By to the AWS CLI, AWS SDKs, or ls with AWS resources in the AWS APIs. IAM User Guide. IAM (Not recommended) Use long-term credentials to Following the instructions for the interface that you want to sign programmatic requests use. to the AWS CLI, AWS SDKs, or AWS APIs. • For the AWS CLI, see Authenticating using IAM user credentials in the AWS Command Line Interface User Guide. • For AWS SDKs and tools, see Authenticate using long-term credentials in the AWS SDKs and Tools Reference Guide. • For AWS APIs, see Managing access keys for IAM users in the IAM User Guide. Best practices Best practices are recommendations that can help you use AWS Certificate Manager (AWS Certificate Manager) more effectively. The following best practices are based on real-world experience from current ACM customers. Topics • Account-level separation • AWS CloudFormation • Certificate pinning • Domain validation Best practices Version 1.0 127 AWS Certificate Manager User Guide • Adding or deleting domain names • Opting out of certificate transparency logging • Turn on AWS CloudTrail Account-level separation Use account-level separation in your policies to control who can access certificates at an account level. Keep your production certificates in separate accounts than your testing and development certificates. If you can't use account-level separation, you can restrict access to specific roles by denying kms:CreateGrant action in your policies. This limits which roles in an account can sign certificates at a high level. For information about grants, including grant terminology, see Grants in AWS KMS in the AWS Key Management Service Developer Guide. If you want more granular control than restricting the use of kms:CreateGrant by account, you can limit kms:CreateGrant to specific certificates using kms:EncryptionContext condition keys. Specify arn:aws:acm as the key, and the value of the ARN to restrict. The following example policy prevents the use of a specific certificate, but allow others. { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Deny", "Action": "kms:CreateGrant", "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:acm:arn": "arn:aws:acm:us- east-1:111122223333:certificate/b26def74-1234-4321-9876-951d4c07b197" } } } ] } Account-level separation Version 1.0 128 AWS Certificate Manager AWS CloudFormation User Guide With AWS CloudFormation you can create a template that describes the AWS resources that you want to use. AWS CloudFormation then provisions and configures those resources for you. AWS CloudFormation can provision resources that are supported by ACM such as Elastic Load Balancing, Amazon CloudFront, and Amazon API Gateway. For more information, see Services integrated with ACM. If you use AWS CloudFormation to quickly create and delete multiple test environments, we recommend that you do not create a separate ACM certificate for each environment. Doing so will quickly exhaust your certificate quota. For more information, see Quotas. Instead, create a wildcard certificate that covers all of the domain names that you are using for testing. For example, if you repeatedly create ACM certificates for domain names that vary by only |
acm-ug-049 | acm-ug.pdf | 49 | can provision resources that are supported by ACM such as Elastic Load Balancing, Amazon CloudFront, and Amazon API Gateway. For more information, see Services integrated with ACM. If you use AWS CloudFormation to quickly create and delete multiple test environments, we recommend that you do not create a separate ACM certificate for each environment. Doing so will quickly exhaust your certificate quota. For more information, see Quotas. Instead, create a wildcard certificate that covers all of the domain names that you are using for testing. For example, if you repeatedly create ACM certificates for domain names that vary by only a version number, such as <version>.service.example.com, create instead a single wildcard certificate for <*>.service.example.com. Important If you're using Amazon CloudFront distributions, note that HTTP validation doesn't support wildcard certificates. When including wildcard certificates in your AWS CloudFormation templates for use with Amazon CloudFront, you must use either DNS validation or email validation. We recommend DNS validation for automated renewal capabilities. Include the wildcard certificate in the template that AWS CloudFormation uses to create your test environment. Certificate pinning Certificate pinning, sometimes known as SSL pinning, is a process that you can use in your application to validate a remote host by associating that host directly with its X.509 certificate or public key instead of with a certificate hierarchy. The application therefore uses pinning to bypass SSL/TLS certificate chain validation. The typical SSL validation process checks signatures throughout the certificate chain from the root certificate authority (CA) certificate through the subordinate CA certificates, if any. It also checks the certificate for the remote host at the bottom of the hierarchy. Your application can instead pin to the certificate for the remote host to say that only that certificate and not the root certificate or any other in the chain is trusted. You can add the AWS CloudFormation Version 1.0 129 AWS Certificate Manager User Guide remote host's certificate or public key to your application during development. Alternatively, the application can add the certificate or key when it first connects to the host. Warning We recommend that your application not pin an ACM certificate. ACM performs Managed certificate renewal in AWS Certificate Manager to automatically renew your Amazon- issued SSL/TLS certificates before they expire. To renew a certificate, ACM generates a new public-private key pair. If your application pins the ACM certificate and the certificate is successfully renewed with a new public key, the application might be unable to connect to your domain. If you decide to pin a certificate, the following options will not hinder your application from connecting to your domain: • Import your own certificate into ACM and then pin your application to the imported certificate. ACM doesn't try to automatically renew imported certificates. • If you're using a public certificate, pin your application to all available Amazon root certificates. If you're using a private certificate, pin your application to the CA's root certificate. Domain validation Before the Amazon certificate authority (CA) can issue a certificate for your site, AWS Certificate Manager (ACM) must verify that you own or control all the domains that you specified in your request. You can perform verification using either email or DNS. For more information, see AWS Certificate Manager DNS validation and AWS Certificate Manager email validation. Adding or deleting domain names You cannot add or remove domain names from an existing ACM certificate. Instead you must request a new certificate with the revised list of domain names. For example, if your certificate has five domain names and you want to add four more, you must request a new certificate with all nine domain names. As with any new certificate, you must validate ownership of all the domain names in the request, including the names that you previously validated for the original certificate. If you use email validation, you receive up to 8 validation email messages for each domain, at least 1 of which must be acted upon within 72 hours. For example, when you request a certificate with Domain validation Version 1.0 130 AWS Certificate Manager User Guide five domain names, you receive up to 40 validation messages, at least 5 of which must be acted upon within 72 hours. As the number of domain names in the certificate request increases, so does the work required to use email to validate domain ownership. If you use DNS validation instead, you must write one new DNS record to the database for the FQDN you want to validate. ACM sends you the record to create and later queries the database to determine whether the record has been added. Adding the record asserts that you own or control the domain. In the preceding example, if you request a certificate with five domain names, you must create five DNS records. We recommend that you use DNS |
acm-ug-050 | acm-ug.pdf | 50 | number of domain names in the certificate request increases, so does the work required to use email to validate domain ownership. If you use DNS validation instead, you must write one new DNS record to the database for the FQDN you want to validate. ACM sends you the record to create and later queries the database to determine whether the record has been added. Adding the record asserts that you own or control the domain. In the preceding example, if you request a certificate with five domain names, you must create five DNS records. We recommend that you use DNS validation when possible. Opting out of certificate transparency logging Important Regardless of the actions you take to opt out of certificate transparency logging, your certificate might still be logged by any client or individual that has access to the public or private endpoint to which you bind the certificate. However, the certificate won't contain a signed certificate time stamp (SCT). Only the issuing CA can embed an SCT in a certificate. As of April 30 2018, Google Chrome no longer trusts public SSL/TLS certificates that are not recorded in a certificate transparency log. Therefore, beginning April 24 2018, the Amazon CA began publishing all new certificates and renewals to at least two public logs. Once a certificate has been logged, it cannot be removed. For more information, see Certificate Transparency Logging. Logging is performed automatically when you request a certificate or when a certificate is renewed, but you can choose to opt out. Common reasons for doing so include concerns about security and privacy. For example, logging internal host domain names gives potential attackers information about internal networks that would otherwise not be public. In addition, logging could leak the names of new or unreleased products and websites. To opt out of transparency logging when you are requesting a certificate, use the options parameter of the request-certificate AWS CLI command or the RequestCertificate API operation. If your certificate was issued before April 24, 2018, and you want to make sure that it is not logged during renewal, you can use the update-certificate-options command or the UpdateCertificateOptions API operation to opt out. Opting out of certificate transparency logging Version 1.0 131 AWS Certificate Manager Limitations User Guide • You cannot use the console to enable or disable transparency logging. • You cannot change logging status after a certificate enters its renewal period, typically 60 days before certificate expiry. No error message is generated if a status change fails. Once a certificate has been logged, it cannot be removed from the log. Opting out at that point will have no effect. If you opt out of logging when you request a certificate and then choose later to opt back in, your certificate will not be logged until it is renewed. If you want the certificate to be logged immediately, we recommend that you issue a new one. The following example shows you how to use the request-certificate command to disable certificate transparency when you request a new certificate. aws acm request-certificate \ --domain-name www.example.com \ --validation-method DNS \ --options CertificateTransparencyLoggingPreference=DISABLED \ The preceding command outputs the ARN of your new certificate. { "CertificateArn": "arn:aws:acm:region:account:certificate/certificate_ID" } If you already have a certificate, and you don't want it to be logged when it is renewed, use the update-certificate-options command. This command does not return a value. aws acm update-certificate-options \ --certificate-arn arn:aws:acm:region:account:\ certificate/certificate_ID \ --options CertificateTransparencyLoggingPreference=DISABLED Turn on AWS CloudTrail Turn on CloudTrail logging before you begin using ACM. CloudTrail enables you to monitor your AWS deployments by retrieving a history of AWS API calls for your account, including API calls made via the AWS Management Console, the AWS SDKs, the AWS Command Line Interface, and Turn on AWS CloudTrail Version 1.0 132 AWS Certificate Manager User Guide higher-level Amazon Web Services. You can also identify which users and accounts called the ACM APIs, the source IP address the calls were made from, and when the calls occurred. You can integrate CloudTrail into applications using the API, automate trail creation for your organization, check the status of your trails, and control how administrators turn CloudTrail logging on and off. For more information, see Creating a Trail. Go to Using CloudTrail with AWS Certificate Manager to see example trails for ACM actions. Turn on AWS CloudTrail Version 1.0 133 AWS Certificate Manager User Guide Monitor and log AWS Certificate Manager Monitoring is an important part of maintaining the reliability, availability, and performance of AWS Certificate Manager and your AWS solutions. You should collect monitoring data from all of the parts of your AWS solution so that you can more easily debug a multi-point failure if one occurs. The following topics describe AWS cloud-monitoring tools available for use with ACM. Topics • Using Amazon EventBridge • |
acm-ug-051 | acm-ug.pdf | 51 | a Trail. Go to Using CloudTrail with AWS Certificate Manager to see example trails for ACM actions. Turn on AWS CloudTrail Version 1.0 133 AWS Certificate Manager User Guide Monitor and log AWS Certificate Manager Monitoring is an important part of maintaining the reliability, availability, and performance of AWS Certificate Manager and your AWS solutions. You should collect monitoring data from all of the parts of your AWS solution so that you can more easily debug a multi-point failure if one occurs. The following topics describe AWS cloud-monitoring tools available for use with ACM. Topics • Using Amazon EventBridge • Using CloudTrail with AWS Certificate Manager • Supported CloudWatch metrics Using Amazon EventBridge You can use Amazon EventBridge (formerly CloudWatch Events) to automate your AWS services and respond automatically to system events such as application availability issues or resource changes. Events from AWS services, including ACM, are delivered to Amazon EventBridge in near- real time. You can use events to trigger targets including AWS Lambda functions, AWS Batch jobs, Amazon SNS topics, and many others. For more information, see What Is Amazon EventBridge? Topics • Amazon EventBridge support for ACM • Triggering actions with Amazon EventBridge in ACM Amazon EventBridge support for ACM This topic lists and describes the ACM related events supported by Amazon EventBridge. ACM Certificate Approaching Expiration event ACM sends daily expiration events for all active certificates (public, private and imported) starting 45 days prior to expiration. This timing can be changed using the PutAccountConfiguration action of the ACM API. ACM automatically initiates renewal of eligible certificates that it issued, but imported certificates need to be reissued and reimported prior to expiration to avoid outages. For more information, Amazon EventBridge Version 1.0 134 AWS Certificate Manager User Guide see Reimporting a certificate. You can use expiration events to set up automation to reimport certificates into ACM. For an example of automation using AWS Lambda, see Triggering actions with Amazon EventBridge in ACM. ACM Certificate Approaching Expiration events have the following structure. { "version": "0", "id": "id", "detail-type": "ACM Certificate Approaching Expiration", "source": "aws.acm", "account": "account", "time": "2020-09-30T06:51:08Z", "region": "region", "resources": [ "arn:aws:acm:region:account:certificate/certificate_ID" ], "detail": { "DaysToExpiry": 31, "CommonName": "example.com" } } ACM Certificate Expired event Note Certificate Expired events aren't available for imported certificates. Customers can listen on this event to alert them if an ACM issued public or private certificate in their account expires. ACM Certificate Expired events have the following structure. { "version": "0", "id": "id", "detail-type": "ACM Certificate Expired", "source": "aws.acm", "account": "account", "time": "2019-12-22T18:43:48Z", Supported events Version 1.0 135 User Guide AWS Certificate Manager "region": "region", "resources": [ "arn:aws:acm:region:account:certificate/certificate_ID" ], "detail": { "CertificateType" : "AMAZON_ISSUED" | "PRIVATE", "CommonName": "example.com", "DomainValidationMethod" : "EMAIL" | "DNS", "CertificateCreatedDate" : "2018-12-22T18:43:48Z", "CertificateExpirationDate" : "2019-12-22T18:43:48Z", "InUse" : TRUE | FALSE, "Exported" : TRUE | FALSE } } ACM Certificate Available event Customers can listen on this event to be notified when a managed public or private certificate is ready for use. The event is published on issuance, renewal, and import. For a private certificate, once it becomes available, customer action is still required to deploy it to hosts. ACM Certificate Available events have the following structure. { "version": "0", "id": "id", "detail-type": "ACM Certificate Available", "source": "aws.acm", "account": "account", "time": "2019-12-22T18:43:48Z", "region": "region", "resources": [ "arn:aws:acm:region:account:certificate/certificate_ID" ], "detail": { “Action” : "ISSUANCE" | "RENEWAL" | "IMPORT" | "REIMPORT", "CertificateType" : "AMAZON_ISSUED" | "PRIVATE" | "IMPORTED", "CommonName": "example.com", "DomainValidationMethod" : "EMAIL" | "DNS", "CertificateCreatedDate" : "2019-12-22T18:43:48Z", "CertificateExpirationDate" : "2019-12-22T18:43:48Z", "DaysToExpiry" : 395, "InUse" : TRUE | FALSE, Supported events Version 1.0 136 AWS Certificate Manager User Guide "Exported" : TRUE | FALSE } } ACM Certificate Renewal Action Required event Note Certificate Renewal Action Required events aren't available for imported certificates. Customers can listen on this event to be alerted when a customer action must be taken before a certificate can be renewed. For instance, if a customer adds CAA records that prevent ACM from renewing a certificate, ACM publishes this event when automatic renewal fails at 45 days before expiration. If no customer action is taken, ACM makes further renewal attempts at 30 days, 15 days, 3 days, and 1 day, or until customer action is taken, the certificate expires, or the certificate is no longer eligible for renewal. An event is published for each of these renewal attempts. ACM Certificate Renewal Action Required events have the following structure. { "version": "0", "id": "id", "detail-type": "ACM Certificate Renewal Action Required", "source": "aws.acm", "account": "account", "time": "2019-12-22T18:43:48Z", "region": "region", "resources": [ "arn:aws:acm:region:account:certificate/certificate_ID" ], "detail": { "CertificateType" : "AMAZON_ISSUED" | "PRIVATE", "CommonName": "example.com", "DomainValidationMethod" : "EMAIL" | "DNS", "RenewalStatusReason" : "CAA_ERROR" | "PENDING_DOMAIN_VALIDATION" | "NO_AVAILABLE_CONTACTS" | "ADDITIONAL_VERIFICATION_REQUIRED" | "DOMAIN_NOT_ALLOWED" | "INVALID_PUBLIC_DOMAIN" | "DOMAIN_VALIDATION_DENIED" | "PCA_LIMIT_EXCEEDED" | "PCA_INVALID_ARN" | "PCA_INVALID_STATE" | "PCA_REQUEST_FAILED" | "PCA_NAME_CONSTRAINTS_VALIDATION" | "PCA_RESOURCE_NOT_FOUND" | "PCA_INVALID_ARGS" | "PCA_INVALID_DURATION" | |
acm-ug-052 | acm-ug.pdf | 52 | certificate expires, or the certificate is no longer eligible for renewal. An event is published for each of these renewal attempts. ACM Certificate Renewal Action Required events have the following structure. { "version": "0", "id": "id", "detail-type": "ACM Certificate Renewal Action Required", "source": "aws.acm", "account": "account", "time": "2019-12-22T18:43:48Z", "region": "region", "resources": [ "arn:aws:acm:region:account:certificate/certificate_ID" ], "detail": { "CertificateType" : "AMAZON_ISSUED" | "PRIVATE", "CommonName": "example.com", "DomainValidationMethod" : "EMAIL" | "DNS", "RenewalStatusReason" : "CAA_ERROR" | "PENDING_DOMAIN_VALIDATION" | "NO_AVAILABLE_CONTACTS" | "ADDITIONAL_VERIFICATION_REQUIRED" | "DOMAIN_NOT_ALLOWED" | "INVALID_PUBLIC_DOMAIN" | "DOMAIN_VALIDATION_DENIED" | "PCA_LIMIT_EXCEEDED" | "PCA_INVALID_ARN" | "PCA_INVALID_STATE" | "PCA_REQUEST_FAILED" | "PCA_NAME_CONSTRAINTS_VALIDATION" | "PCA_RESOURCE_NOT_FOUND" | "PCA_INVALID_ARGS" | "PCA_INVALID_DURATION" | "PCA_ACCESS_DENIED" | "SLR_NOT_FOUND" | "OTHER", "DaysToExpiry": 30, Supported events Version 1.0 137 AWS Certificate Manager User Guide "CertificateExpirationDate" : "2019-12-22T18:43:48Z", "InUse" : TRUE | FALSE, "Exported" : TRUE | FALSE } } AWS health events AWS health events are generated for ACM certificates that are eligible for renewal. For information about renewal eligibility, see Managed certificate renewal in AWS Certificate Manager. Health events are generated in two scenarios: • On successful renewal of a public or private certificate. • When a customer must take action for a renewal to occur. This may mean clicking a link in an email message (for email-validated certificates), or resolving an error. One of the following event codes is included with each event. The codes are exposed as variables that you can use for filtering. • AWS_ACM_RENEWAL_STATE_CHANGE (the certificate has been renewed, has expired, or is due to expire) • CAA_CHECK_FAILURE (CAA check failed) • AWS_ACM_RENEWAL_FAILURE (for certificates signed by a private CA) Health events have the following structure. In this example, an AWS_ACM_RENEWAL_STATE_CHANGE event has been generated. { "source":[ "aws.health" ], "detail-type":[ "AWS Health Event" ], "detail":{ "service":[ "ACM" ], "eventTypeCategory":[ "scheduledChange" ], Supported events Version 1.0 138 AWS Certificate Manager User Guide "eventTypeCode":[ "AWS_ACM_RENEWAL_STATE_CHANGE" ] } } Triggering actions with Amazon EventBridge in ACM You can create Amazon EventBridge rules based on these events and use the Amazon EventBridge console to configure actions that take place when the events are detected. This section provides sample procedures for configuring Amazon EventBridge rules and resulting actions. Topics • Responding to an event with Amazon SNS • Responding to an event with a Lambda function Responding to an event with Amazon SNS This section shows how to configure Amazon SNS to send a text notification whenever ACM generates a health event. Complete the following procedure to configure a response. To create a Amazon EventBridge rule and trigger an action 1. Create an Amazon EventBridge rule. For more information, see Creating Amazon EventBridge rules that react to events. a. In the Amazon EventBridge console at https://console.aws.amazon.com/events/, navigate to the Events > Rules page and choose Create rule. b. On the Create rule page, select Event Pattern. c. d. e. f. For Service Name, choose Health from the menu. For Event Type, choose Specific Health events. Select Specific service(s) and choose ACM from the menu. Select Specific event type category(s) and choose accountNotification. g. Choose Any event type code. h. Choose Any resource. Example actions Version 1.0 139 AWS Certificate Manager User Guide i. In the Event pattern preview editor, paste the JSON pattern emitted by the event. This example uses the pattern from the AWS health events section. { "source":[ "aws.health" ], "detail-type":[ "AWS Health Event" ], "detail":{ "service":[ "ACM" ], "eventTypeCategory":[ "scheduledChange" ], "eventTypeCode":[ "AWS_ACM_RENEWAL_STATE_CHANGE" ] } } 2. Configure an action. In the Targets section, you can choose from among many services that can immediately consume your event, such as Amazon Simple Notification Service (SNS), or you can choose Lambda function to pass the event to customized executable code. For an example of an AWS Lambda implementation, see Responding to an event with a Lambda function. Responding to an event with a Lambda function This procedure demonstrates how to use AWS Lambda to listen on Amazon EventBridge, create notifications with Amazon Simple Notification Service (SNS), and publish findings to AWS Security Hub, providing visibility to administrators and security teams. To set up a Lambda function and IAM role 1. First configure an AWS Identity and Access Management (IAM) role and define the permissions needed by the Lambda function. This security best practice gives you flexibility in designating Example actions Version 1.0 140 AWS Certificate Manager User Guide who has authorization to call the function, and in limiting the permissions granted to that person. It is not recommended to run most AWS operations directly under a user account and especially not under an administrator account. Open the IAM console at https://console.aws.amazon.com/iam/. 2. Use the JSON policy editor to create the policy defined in the template below. Provide your own Region and AWS account details. For more information, see Creating policies on the JSON tab. { "Version":"2012-10-17", "Statement":[ { "Sid":"LambdaCertificateExpiryPolicy1", "Effect":"Allow", "Action":"logs:CreateLogGroup", "Resource":"arn:aws:logs:<region>:<AWS-ACCT-NUMBER>:*" }, { "Sid":"LambdaCertificateExpiryPolicy2", "Effect":"Allow", |
acm-ug-053 | acm-ug.pdf | 53 | in designating Example actions Version 1.0 140 AWS Certificate Manager User Guide who has authorization to call the function, and in limiting the permissions granted to that person. It is not recommended to run most AWS operations directly under a user account and especially not under an administrator account. Open the IAM console at https://console.aws.amazon.com/iam/. 2. Use the JSON policy editor to create the policy defined in the template below. Provide your own Region and AWS account details. For more information, see Creating policies on the JSON tab. { "Version":"2012-10-17", "Statement":[ { "Sid":"LambdaCertificateExpiryPolicy1", "Effect":"Allow", "Action":"logs:CreateLogGroup", "Resource":"arn:aws:logs:<region>:<AWS-ACCT-NUMBER>:*" }, { "Sid":"LambdaCertificateExpiryPolicy2", "Effect":"Allow", "Action":[ "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource":[ "arn:aws:logs:<region>:<AWS-ACCT-NUMBER>:log-group:/aws/lambda/handle- expiring-certificates:*" ] }, { "Sid":"LambdaCertificateExpiryPolicy3", "Effect":"Allow", "Action":[ "acm:DescribeCertificate", "acm:GetCertificate", "acm:ListCertificates", "acm:ListTagsForCertificate" ], "Resource":"*" }, { Example actions Version 1.0 141 AWS Certificate Manager User Guide "Sid":"LambdaCertificateExpiryPolicy4", "Effect":"Allow", "Action":"SNS:Publish", "Resource":"*" }, { "Sid":"LambdaCertificateExpiryPolicy5", "Effect":"Allow", "Action":[ "SecurityHub:BatchImportFindings", "SecurityHub:BatchUpdateFindings", "SecurityHub:DescribeHub" ], "Resource":"*" }, { "Sid":"LambdaCertificateExpiryPolicy6", "Effect":"Allow", "Action":"cloudwatch:ListMetrics", "Resource":"*" } ] } 3. Create an IAM role and attach the new policy to it. For information about creating an IAM role and attaching a policy, see Creating a role for an AWS service (console). 4. Open the AWS Lambda console at https://console.aws.amazon.com/lambda/. 5. Create the Lambda function. For more information, see Create a Lambda function with the console. Complete the following steps: a. On the Create function page, choose the Author from scratch option to create the function. b. c. d. e. f. Specify a name such as "handle-expiring-certificates" in the Function name field. Choose Python 3.8 from the Runtime list. Expand Change default execution role and choose Use an existing role. Choose the role you previously created from the Existing role list. Choose Create function. g. Under Function code, insert the following code: # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Example actions Version 1.0 142 AWS Certificate Manager User Guide # SPDX-License-Identifier: MIT-0 # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to use, copy, modify, # merge, publish, distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import json import boto3 import os from datetime import datetime, timedelta, timezone # ------------------------------------------- # setup global data # ------------------------------------------- utc = timezone.utc # make today timezone aware today = datetime.now().replace(tzinfo=utc) # set up time window for alert - default to 45 if its missing if os.environ.get('EXPIRY_DAYS') is None: expiry_days = 45 else: expiry_days = int(os.environ['EXPIRY_DAYS']) expiry_window = today + timedelta(days = expiry_days) def lambda_handler(event, context): # if this is coming from the ACM event, its for a single certificate if (event['detail-type'] == "ACM Certificate Approaching Expiration"): response = handle_single_cert(event, context.invoked_function_arn) return { Example actions Version 1.0 143 AWS Certificate Manager User Guide 'statusCode': 200, 'body': response } def handle_single_cert(event, context_arn): cert_client = boto3.client('acm') cert_details = cert_client.describe_certificate(CertificateArn=event['resources'][0]) result = 'The following certificate is expiring within ' + str(expiry_days) + ' days: ' + cert_details['Certificate']['DomainName'] # check the expiry window before logging to Security Hub and sending an SNS if cert_details['Certificate']['NotAfter'] < expiry_window: # This call is the text going into the SNS notification result = result + ' (' + cert_details['Certificate']['CertificateArn'] + ') ' # this call is publishing to SH result = result + ' - ' + log_finding_to_sh(event, cert_details, context_arn) # if there's an SNS topic, publish a notification to it if os.environ.get('SNS_TOPIC_ARN') is None: response = result else: sns_client = boto3.client('sns') response = sns_client.publish(TopicArn=os.environ['SNS_TOPIC_ARN'], Message=result, Subject='Certificate Expiration Notification') return result def log_finding_to_sh(event, cert_details, context_arn): # setup for security hub sh_region = get_sh_region(event['region']) sh_hub_arn = "arn:aws:securityhub:{0}:{1}:hub/default".format(sh_region, event['account']) sh_product_arn = "arn:aws:securityhub:{0}:{1}:product/{1}/ default".format(sh_region, event['account']) # check if security hub is enabled, and if the hub arn exists sh_client = boto3.client('securityhub', region_name = sh_region) try: sh_enabled = sh_client.describe_hub(HubArn = sh_hub_arn) # the previous command throws an error indicating the hub doesn't exist or lambda doesn't have rights to it so we'll stop attempting to use it except Exception as error: sh_enabled = None print ('Default Security Hub product doesn\'t exist') response = 'Security Hub disabled' # This is used to generate the URL to the cert in the Security Hub Findings to link directly to it Example actions Version 1.0 144 |
acm-ug-054 | acm-ug.pdf | 54 | = "arn:aws:securityhub:{0}:{1}:product/{1}/ default".format(sh_region, event['account']) # check if security hub is enabled, and if the hub arn exists sh_client = boto3.client('securityhub', region_name = sh_region) try: sh_enabled = sh_client.describe_hub(HubArn = sh_hub_arn) # the previous command throws an error indicating the hub doesn't exist or lambda doesn't have rights to it so we'll stop attempting to use it except Exception as error: sh_enabled = None print ('Default Security Hub product doesn\'t exist') response = 'Security Hub disabled' # This is used to generate the URL to the cert in the Security Hub Findings to link directly to it Example actions Version 1.0 144 AWS Certificate Manager User Guide cert_id = right(cert_details['Certificate']['CertificateArn'], 36) if sh_enabled: # set up a new findings list new_findings = [] # add expiring certificate to the new findings list new_findings.append({ "SchemaVersion": "2018-10-08", "Id": cert_id, "ProductArn": sh_product_arn, "GeneratorId": context_arn, "AwsAccountId": event['account'], "Types": [ "Software and Configuration Checks/AWS Config Analysis" ], "CreatedAt": event['time'], "UpdatedAt": event['time'], "Severity": { "Original": '89.0', "Label": 'HIGH' }, "Title": 'Certificate expiration', "Description": 'cert expiry', 'Remediation': { 'Recommendation': { 'Text': 'A new certificate for ' + cert_details['Certificate']['DomainName'] + ' should be imported to replace the existing imported certificate before expiration', 'Url': "https://console.aws.amazon.com/acm/home?region=" + event['region'] + "#/?id=" + cert_id } }, 'Resources': [ { 'Id': event['id'], 'Type': 'ACM Certificate', 'Partition': 'aws', 'Region': event['region'] } ], 'Compliance': {'Status': 'WARNING'} }) # push any new findings to security hub if new_findings: try: Example actions Version 1.0 145 AWS Certificate Manager User Guide response = sh_client.batch_import_findings(Findings=new_findings) if response['FailedCount'] > 0: print("Failed to import {} findings".format(response['FailedCount'])) except Exception as error: print("Error: ", error) raise return json.dumps(response) # function to setup the sh region def get_sh_region(event_region): # security hub findings may need to go to a different region so set that here if os.environ.get('SECURITY_HUB_REGION') is None: sh_region_local = event_region else: sh_region_local = os.environ['SECURITY_HUB_REGION'] return sh_region_local # quick function to trim off right side of a string def right(value, count): # To get right part of string, use negative first index in slice. return value[-count:] h. Under Environment variables, choose Edit and optionally add the following variables. • (Optional) EXPIRY_DAYS Specifies how much lead time, in days, before the certificate expiration notice is sent. The function defaults to 45 days, but you can specify custom values. • (Optional) SNS_TOPIC_ARN Specifies an ARN for an Amazon SNS. Provide the full ARN in the format of arn:aws:sns:<region>:<account-number>:<topic-name>. • (Optional) SECURITY_HUB_REGION Specifies an AWS Security Hub in a different Region. If this is not specified, the Region of the running Lambda function is used. If the function is run in multiple Regions, it may be desirable to have all certificate messages go to Security Hub in a single Region. i. j. Under Basic settings, set Timeout to 30 seconds. At the top of the page, choose Deploy. Example actions Version 1.0 146 AWS Certificate Manager User Guide Complete the tasks in the following procedure to begin using this solution. To automate an email notice of expiration In this example, we provide a single email for each expiring certificate at the moment the event is raised through Amazon EventBridge. By default, ACM raises an event each day for a certificate that is 45 days or less from expiration. (This period can be customized using the PutAccountConfiguration operation of the ACM API.) Each of these events triggers the following cascade of automated actions: ACM raises Amazon EventBridge event # >>>>>>> events Event matches Amazon EventBridge rule # Rule calls Lambda function # Function sends SNS email and logs a Finding in Security Hub 1. Create the Lambda function and configure permissions. (Already completed – see To set up a Lambda function and IAM role). 2. Create a standard SNS topic for the Lambda function to use to send out notifications. For more information, see Creating an Amazon SNS topic. 3. Subscribe any interested parties to the new SNS topic. For more information, see Subscribing to an Amazon SNS topic. 4. Create an Amazon EventBridge rule to trigger the Lambda function. For more information, see Creating Amazon EventBridge rules that react to events. In the Amazon EventBridge console at https://console.aws.amazon.com/events/, navigate to the Events > Rules page and choose Create rule. Specify Service Name, Event Type, and Lambda function. In the Event Pattern preview editor, paste the following code: { "source": [ "aws.acm" ], "detail-type": [ "ACM Certificate Approaching Expiration" ] Example actions Version 1.0 147 AWS Certificate Manager } User Guide An event such as Lambda receives is displayed under Show sample event(s): { "version": "0", "id": "9c95e8e4-96a4-ef3f-b739-b6aa5b193afb", "detail-type": "ACM Certificate Approaching Expiration", "source": "aws.acm", "account": "123456789012", "time": "2020-09-30T06:51:08Z", "region": "us-east-1", "resources": [ "arn:aws:acm:us-east-1:123456789012:certificate/61f50cd4-45b9-4259-b049- d0a53682fa4b" ], "detail": { "DaysToExpiry": 31, "CommonName": "My Awesome Service" } } To clean up Once you no longer need the example configuration, or any configuration, it is a best practice to remove all traces of |
acm-ug-055 | acm-ug.pdf | 55 | Event Pattern preview editor, paste the following code: { "source": [ "aws.acm" ], "detail-type": [ "ACM Certificate Approaching Expiration" ] Example actions Version 1.0 147 AWS Certificate Manager } User Guide An event such as Lambda receives is displayed under Show sample event(s): { "version": "0", "id": "9c95e8e4-96a4-ef3f-b739-b6aa5b193afb", "detail-type": "ACM Certificate Approaching Expiration", "source": "aws.acm", "account": "123456789012", "time": "2020-09-30T06:51:08Z", "region": "us-east-1", "resources": [ "arn:aws:acm:us-east-1:123456789012:certificate/61f50cd4-45b9-4259-b049- d0a53682fa4b" ], "detail": { "DaysToExpiry": 31, "CommonName": "My Awesome Service" } } To clean up Once you no longer need the example configuration, or any configuration, it is a best practice to remove all traces of it to avoid security problems and unexpected future charges: • IAM policy and role • Lambda function • CloudWatch Events rule • CloudWatch Logs associated with Lambda • SNS Topic Using CloudTrail with AWS Certificate Manager AWS Certificate Manager is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in ACM. CloudTrail is enabled by default on your AWS account. CloudTrail captures API calls for ACM as events, including calls from the ACM console CloudTrail Version 1.0 148 AWS Certificate Manager User Guide and code calls to the ACM API operations. If you configure a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for ACM. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to ACM, the IP address from which the request was made, who made the request, when it was made, and additional details. For more information, see Viewing Events with CloudTrail Event History. When supported event activity occurs in ACM, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information about CloudTrail, consult the following documentation: • AWS CloudTrail User Guide. • Overview for Creating a Trail • CloudTrail Supported Services and Integrations • Configuring Amazon SNS Notifications for CloudTrail • Receiving CloudTrail Log Files from Multiple Regions and Receiving CloudTrail Log Files from Multiple Accounts Topics • ACM API actions supported in CloudTrail logging • Logging API calls for integrated services ACM API actions supported in CloudTrail logging ACM supports logging the following actions as events in CloudTrail log files: Every event or log entry contains information about who generated the request. The identity information helps you determine the following: • Whether the request was made with AWS account root user or AWS Identity and Access Management (IAM) user credentials. Supported API actions Version 1.0 149 AWS Certificate Manager User Guide • Whether the request was made with temporary security credentials for a role or federated user. • Whether the request was made by another AWS service For more information, see the CloudTrail userIdentity Element. The following sections provide example logs for the supported API operations. • Adding tags to a certificate (AddTagsToCertificate) • Deleting a certificate (DeleteCertificate) • Describing a certificate (DescribeCertificate) • Exporting a certificate (ExportCertificate) • Import a certificate (ImportCertificate) • Listing certificates (ListCertificates) • Listing tags for a certificate (ListTagsForCertificate) • Removing tags from a certificate (RemoveTagsFromCertificate) • Requesting a certificate (RequestCertificate) • Resending validation email (ResendValidationEmail) • Retrieving a certificate (GetCertificate) Adding tags to a certificate (AddTagsToCertificate) The following CloudTrail example shows the results of a call to the AddTagsToCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-04-06T13:53:53Z", Supported API actions Version 1.0 150 AWS Certificate Manager User Guide "eventSource":"acm.amazonaws.com", "eventName":"AddTagsToCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.10.16", "requestParameters":{ "tags":[ { "value":"Alice", "key":"Admin" } ], "certificateArn":"arn:aws:acm:us-east-1:123456789012:certificate/ fedcba98-7654-3210-fedc-ba9876543210" }, "responseElements":null, "requestID":"fedcba98-7654-3210-fedc-ba9876543210", "eventID":"fedcba98-7654-3210-fedc-ba9876543210", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Deleting a certificate (DeleteCertificate) The following CloudTrail example shows the results of a call to the DeleteCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:26Z", "eventSource":"acm.amazonaws.com", Supported API actions Version 1.0 151 AWS Certificate Manager User Guide "eventName":"DeleteCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "certificateArn":"arn:aws:acm:us-east-1:123456789012:certificate/ fedcba98-7654-3210-fedc-ba9876543210" }, "responseElements":null, "requestID":"01234567-89ab-cdef-0123-456789abcdef", "eventID":"01234567-89ab-cdef-0123-456789abcdef", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Describing a certificate (DescribeCertificate) The following CloudTrail example shows the results of a call to the DescribeCertificate API. Note The CloudTrail log for the DescribeCertificate operation does not display information about the ACM certificate you specify. You can view information about the certificate by using the console, the AWS Command Line Interface, or the DescribeCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:42Z", "eventSource":"acm.amazonaws.com", Supported API actions Version 1.0 152 AWS Certificate Manager User Guide "eventName":"DescribeCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ |
acm-ug-056 | acm-ug.pdf | 56 | "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "certificateArn":"arn:aws:acm:us-east-1:123456789012:certificate/ fedcba98-7654-3210-fedc-ba9876543210" }, "responseElements":null, "requestID":"01234567-89ab-cdef-0123-456789abcdef", "eventID":"01234567-89ab-cdef-0123-456789abcdef", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Describing a certificate (DescribeCertificate) The following CloudTrail example shows the results of a call to the DescribeCertificate API. Note The CloudTrail log for the DescribeCertificate operation does not display information about the ACM certificate you specify. You can view information about the certificate by using the console, the AWS Command Line Interface, or the DescribeCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:42Z", "eventSource":"acm.amazonaws.com", Supported API actions Version 1.0 152 AWS Certificate Manager User Guide "eventName":"DescribeCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "certificateArn":"arn:aws:acm:us-east-1:123456789012:certificate/ fedcba98-7654-3210-fedc-ba9876543210" }, "responseElements":null, "requestID":"fedcba98-7654-3210-fedc-ba9876543210", "eventID":"fedcba98-7654-3210-fedc-ba9876543210", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Exporting a certificate (ExportCertificate) The following CloudTrail example shows the results of a call to the ExportCertificate API. { "Records":[ { "version":"0", "id":"01234567-89ab-cdef-0123-456789abcdef", "detail-type":"AWS API Call via CloudTrail", "source":"aws.acm", "account":"123456789012", "time":"2018-05-24T15:28:11Z", "region":"us-east-1", "resources":[ ], "detail":{ "eventVersion":"1.04", "userIdentity":{ "type":"Root", "principalId":"123456789012", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" Supported API actions Version 1.0 153 AWS Certificate Manager }, "eventTime":"2018-05-24T15:28:11Z", "eventSource":"acm.amazonaws.com", "eventName":"ExportCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.15.4 Python/2.7.9 Windows/8 botocore/1.10.4", "requestParameters":{ "passphrase":{ User Guide "hb":[ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 ], "offset":0, "isReadOnly":false, "bigEndian":true, "nativeByteOrder":false, "mark":-1, "position":0, "limit":10, "capacity":10, "address":0 }, "certificateArn":"arn:aws:acm:us-east-1:123456789012:certificate/ fedcba98-7654-3210-fedc-ba9876543210" }, "responseElements":{ "certificateChain": "-----BEGIN CERTIFICATE----- base64 certificate -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- base64 certificate -----END CERTIFICATE-----", "privateKey":"**********", "certificate": Supported API actions Version 1.0 154 AWS Certificate Manager User Guide "-----BEGIN CERTIFICATE----- base64 certificate -----END CERTIFICATE-----" }, "requestID":"01234567-89ab-cdef-0123-456789abcdef", "eventID":"fedcba98-7654-3210-fedc-ba9876543210", "eventType":"AwsApiCall" } } ] } Import a certificate (ImportCertificate) The following example shows the CloudTrail log entry that records a call to the ACM ImportCertificate API operation. { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::111122223333:user/Alice", "accountId":"111122223333", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-10-04T16:01:30Z", "eventSource":"acm.amazonaws.com", "eventName":"ImportCertificate", "awsRegion":"ap-southeast-2", "sourceIPAddress":"54.240.193.129", "userAgent":"Coral/Netty", "requestParameters":{ "privateKey":{ "hb":[ "byte", "byte", "byte", "..." ], "offset":0, "isReadOnly":false, Supported API actions Version 1.0 155 AWS Certificate Manager User Guide "bigEndian":true, "nativeByteOrder":false, "mark":-1, "position":0, "limit":1674, "capacity":1674, "address":0 }, "certificateChain":{ "hb":[ "byte", "byte", "byte", "..." ], "offset":0, "isReadOnly":false, "bigEndian":true, "nativeByteOrder":false, "mark":-1, "position":0, "limit":2105, "capacity":2105, "address":0 }, "certificate":{ "hb":[ "byte", "byte", "byte", "..." ], "offset":0, "isReadOnly":false, "bigEndian":true, "nativeByteOrder":false, "mark":-1, "position":0, "limit":2503, "capacity":2503, "address":0 } }, "responseElements":{ Supported API actions Version 1.0 156 AWS Certificate Manager User Guide "certificateArn":"arn:aws:acm:ap- southeast-2:111122223333:certificate/01234567-89ab-cdef-0123-456789abcdef" }, "requestID":"01234567-89ab-cdef-0123-456789abcdef", "eventID":"01234567-89ab-cdef-0123-456789abcdef", "eventType":"AwsApiCall", "recipientAccountId":"111122223333" } Listing certificates (ListCertificates) The following CloudTrail example shows the results of a call to the ListCertificates API. Note The CloudTrail log for the ListCertificates operation does not display your ACM certificates. You can view the certificate list by using the console, the AWS Command Line Interface, or the ListCertificates API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:43Z", "eventSource":"acm.amazonaws.com", "eventName":"ListCertificates", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "maxItems":1000, "certificateStatuses":[ "ISSUED" Supported API actions Version 1.0 157 AWS Certificate Manager ] }, "responseElements":null, "requestID":"74c99844-ec9c-11e5-ac34-d1e4dfe1a11b", "eventID":"cdfe1051-88aa-4aa3-8c33-a325270bff21", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } User Guide Listing tags for a certificate (ListTagsForCertificate) The following CloudTrail example shows the results of a call to the ListTagsForCertificate API. Note The CloudTrail log for the ListTagsForCertificate operation does not display your tags. You can view the tag list by using the console, the AWS Command Line Interface, or the ListTagsForCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-04-06T13:30:11Z", "eventSource":"acm.amazonaws.com", "eventName":"ListTagsForCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.10.16", "requestParameters":{ Supported API actions Version 1.0 158 AWS Certificate Manager User Guide "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" }, "responseElements":null, "requestID":"b010767f-fbfb-11e5-b596-79e9a97a2544", "eventID":"32181be6-a4a0-48d3-8014-c0d972b5163b", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Removing tags from a certificate (RemoveTagsFromCertificate) The following CloudTrail example shows the results of a call to the RemoveTagsFromCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-04-06T14:10:01Z", "eventSource":"acm.amazonaws.com", "eventName":"RemoveTagsFromCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.10.16", "requestParameters":{ "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012", "tags":[ { "value":"Bob", "key":"Admin" } Supported API actions Version 1.0 159 AWS Certificate Manager ] }, "responseElements":null, "requestID":"40ded461-fc01-11e5-a747-85804766d6c9", "eventID":"0cfa142e-ef74-4b21-9515-47197780c424", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } User Guide Requesting a certificate (RequestCertificate) The following CloudTrail example shows the results of a call to the RequestCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:49Z", "eventSource":"acm.amazonaws.com", "eventName":"RequestCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "subjectAlternativeNames":[ "example.net" ], "domainName":"example.com", "domainValidationOptions":[ { "domainName":"example.com", "validationDomain":"example.com" }, Supported API actions Version 1.0 160 User Guide AWS Certificate Manager { "domainName":"example.net", "validationDomain":"example.net" } ], "idempotencyToken":"8186023d89681c3ad5" }, "responseElements":{ "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" }, "requestID":"77dacef3-ec9c-11e5-ac34-d1e4dfe1a11b", "eventID":"a4954cdb-8f38-44c7-8927-a38ad4be3ac8", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Resending validation email (ResendValidationEmail) The following CloudTrail example shows the results of a call to the ResendValidationEmail API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-17T23:58:25Z", "eventSource":"acm.amazonaws.com", "eventName":"ResendValidationEmail", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "domain":"example.com", Supported API actions Version 1.0 161 AWS Certificate Manager User Guide "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012", "validationDomain":"example.com" }, "responseElements":null, "requestID":"23760b88-ec9c-11e5-b6f4-cb861a6f0a28", "eventID":"41c11b06-ca91-4c1c-8c61-af349ea8bab8", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Retrieving a certificate (GetCertificate) The following CloudTrail example shows the results of a call to the GetCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:41Z", "eventSource":"acm.amazonaws.com", "eventName":"GetCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" }, "responseElements":{ "certificateChain": Supported API actions Version |
acm-ug-057 | acm-ug.pdf | 57 | example shows the results of a call to the ResendValidationEmail API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-17T23:58:25Z", "eventSource":"acm.amazonaws.com", "eventName":"ResendValidationEmail", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "domain":"example.com", Supported API actions Version 1.0 161 AWS Certificate Manager User Guide "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012", "validationDomain":"example.com" }, "responseElements":null, "requestID":"23760b88-ec9c-11e5-b6f4-cb861a6f0a28", "eventID":"41c11b06-ca91-4c1c-8c61-af349ea8bab8", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Retrieving a certificate (GetCertificate) The following CloudTrail example shows the results of a call to the GetCertificate API. { "Records":[ { "eventVersion":"1.04", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/Alice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-03-18T00:00:41Z", "eventSource":"acm.amazonaws.com", "eventName":"GetCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "certificateArn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" }, "responseElements":{ "certificateChain": Supported API actions Version 1.0 162 AWS Certificate Manager User Guide "-----BEGIN CERTIFICATE----- Base64-encoded certificate chain -----END CERTIFICATE-----", "certificate": "-----BEGIN CERTIFICATE----- Base64-encoded certificate -----END CERTIFICATE-----" }, "requestID":"744dd891-ec9c-11e5-ac34-d1e4dfe1a11b", "eventID":"7aa4f909-00dd-478a-9a00-b2709bcad2bb", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } ] } Logging API calls for integrated services You can use CloudTrail to audit API calls made by services that are integrated with ACM. For more information about using CloudTrail, see the AWS CloudTrail User Guide. The following examples show the types of logs that can be generated depending on the AWS resources on which you provision the ACM certificate. Topics • Creating a load balancer Creating a load balancer You can use CloudTrail to audit API calls made by services that are integrated with ACM. For more information about using CloudTrail, see the AWS CloudTrail User Guide. The following examples show the types of logs that can be generated depending on the AWS resources on which you provision the ACM certificate. Topics • Creating a Load Balancer • Registering an Amazon EC2 Instance with a Load Balancer • Encrypting a Private Key • Decrypting a Private Key API calls for integrated services Version 1.0 163 AWS Certificate Manager Creating a Load Balancer User Guide The following example shows a call to the CreateLoadBalancer function by an IAM user named Alice. The name of the load balancer is TestLinuxDefault, and the listener is created using an ACM certificate. { "eventVersion":"1.03", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::111122223333:user/Alice", "accountId":"111122223333", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice" }, "eventTime":"2016-01-01T21:10:36Z", "eventSource":"elasticloadbalancing.amazonaws.com", "eventName":"CreateLoadBalancer", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0/24", "userAgent":"aws-cli/1.9.15", "requestParameters":{ "availabilityZones":[ "us-east-1b" ], "loadBalancerName":"LinuxTest", "listeners":[ { "sSLCertificateId":"arn:aws:acm:us- east-1:111122223333:certificate/12345678-1234-1234-1234-123456789012", "protocol":"HTTPS", "loadBalancerPort":443, "instanceProtocol":"HTTP", "instancePort":80 } ] }, "responseElements":{ "dNSName":"LinuxTest-1234567890.us-east-1.elb.amazonaws.com" }, "requestID":"19669c3b-b0cc-11e5-85b2-57397210a2e5", API calls for integrated services Version 1.0 164 AWS Certificate Manager User Guide "eventID":"5d6c00c9-a9b8-46ef-9f3b-4589f5be63f7", "eventType":"AwsApiCall", "recipientAccountId":"111122223333" } Registering an Amazon EC2 Instance with a Load Balancer When you provision your website or application on an Amazon Elastic Compute Cloud (Amazon EC2) instance, the load balancer must be made aware of that instance. This can be accomplished through the Elastic Load Balancing console or the AWS Command Line Interface. The following example shows a call to RegisterInstancesWithLoadBalancer for a load balancer named LinuxTest on AWS account 123456789012. { "eventVersion":"1.03", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::123456789012:user/ALice", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"Alice", "sessionContext":{ "attributes":{ "mfaAuthenticated":"false", "creationDate":"2016-01-01T19:35:52Z" } }, "invokedBy":"signin.amazonaws.com" }, "eventTime":"2016-01-01T21:11:45Z", "eventSource":"elasticloadbalancing.amazonaws.com", "eventName":"RegisterInstancesWithLoadBalancer", "awsRegion":"us-east-1", "sourceIPAddress":"192.0.2.0/24", "userAgent":"signin.amazonaws.com", "requestParameters":{ "loadBalancerName":"LinuxTest", "instances":[ { "instanceId":"i-c67f4e78" } ] API calls for integrated services Version 1.0 165 User Guide AWS Certificate Manager }, "responseElements":{ "instances":[ { "instanceId":"i-c67f4e78" } ] }, "requestID":"438b07dc-b0cc-11e5-8afb-cda7ba020551", "eventID":"9f284ca6-cbe5-42a1-8251-4f0e6b5739d6", "eventType":"AwsApiCall", "recipientAccountId":"123456789012" } Encrypting a Private Key The following example shows an Encrypt call that encrypts the private key associated with an ACM certificate. Encryption is performed within AWS. { "Records":[ { "eventVersion":"1.03", "userIdentity":{ "type":"IAMUser", "principalId":"AIDACKCEVSQ6C2EXAMPLE", "arn":"arn:aws:iam::111122223333:user/acm", "accountId":"111122223333", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "userName":"acm" }, "eventTime":"2016-01-05T18:36:29Z", "eventSource":"kms.amazonaws.com", "eventName":"Encrypt", "awsRegion":"us-east-1", "sourceIPAddress":"AWS Internal", "userAgent":"aws-internal", "requestParameters":{ "keyId":"arn:aws:kms:us-east-1:123456789012:alias/aws/acm", "encryptionContext":{ "aws:acm:arn":"arn:aws:acm:us- east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" } API calls for integrated services Version 1.0 166 User Guide AWS Certificate Manager }, "responseElements":null, "requestID":"3c417351-b3db-11e5-9a24-7d9457362fcc", "eventID":"1794fe70-796a-45f5-811b-6584948f24ac", "readOnly":true, "resources":[ { "ARN":"arn:aws:kms:us- east-1:123456789012:key/87654321-4321-4321-4321-210987654321", "accountId":"123456789012" } ], "eventType":"AwsServiceEvent", "recipientAccountId":"123456789012" } ] } Decrypting a Private Key The following example shows a Decrypt call that decrypts the private key associated with an ACM certificate. Decryption is performed within AWS, and the decrypted key never leaves AWS. { "eventVersion":"1.03", "userIdentity":{ "type":"AssumedRole", "principalId":"AIDACKCEVSQ6C2EXAMPLE:1aba0dc8b3a728d6998c234a99178eff", "arn":"arn:aws:sts::111122223333:assumed-role/ DecryptACMCertificate/1aba0dc8b3a728d6998c234a99178eff", "accountId":"111122223333", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "sessionContext":{ "attributes":{ "mfaAuthenticated":"false", "creationDate":"2016-01-01T21:13:28Z" }, "sessionIssuer":{ "type":"Role", "principalId":"APKAEIBAERJR2EXAMPLE", "arn":"arn:aws:iam::111122223333:role/DecryptACMCertificate", "accountId":"111122223333", "userName":"DecryptACMCertificate" API calls for integrated services Version 1.0 167 User Guide AWS Certificate Manager } } }, "eventTime":"2016-01-01T21:13:28Z", "eventSource":"kms.amazonaws.com", "eventName":"Decrypt", "awsRegion":"us-east-1", "sourceIPAddress":"AWS Internal", "userAgent":"aws-internal/3", "requestParameters":{ "encryptionContext":{ "aws:elasticloadbalancing:arn":"arn:aws:elasticloadbalancing:us- east-1:123456789012:loadbalancer/LinuxTest", "aws:acm:arn":"arn:aws:acm:us- east-1:123456789012:certificate/87654321-4321-4321-4321-210987654321" } }, "responseElements":null, "requestID":"809a70ff-b0cc-11e5-8f42-c7fdf1cb6e6a", "eventID":"7f89f7a7-baff-4802-8a88-851488607fb9", "readOnly":true, "resources":[ { "ARN":"arn:aws:kms:us- east-1:123456789012:key/12345678-1234-1234-1234-123456789012", "accountId":"123456789012" } ], "eventType":"AwsServiceEvent", "recipientAccountId":"123456789012" } Supported CloudWatch metrics Amazon CloudWatch is a monitoring service for AWS resources. You can use CloudWatch to collect and track metrics, set alarms, and automatically react to changes in your AWS resources. ACM publishes metrics once per day for every certificate in an account until expiration. The AWS/CertificateManager namespace includes the following metric. CloudWatch metrics Version 1.0 168 AWS Certificate Manager User Guide Metric Description Unit Dimensions DaysToExpiry Number of days until a certificate expires. ACM stops publishin g this metric after a certificate expires. Integer CertificateArn • Value: ARN of the certificate For more information about CloudWatch metrics, see the following topics: • Using Amazon CloudWatch Metrics • Creating Amazon CloudWatch Alarms CloudWatch metrics Version 1.0 169 |
acm-ug-058 | acm-ug.pdf | 58 | and track metrics, set alarms, and automatically react to changes in your AWS resources. ACM publishes metrics once per day for every certificate in an account until expiration. The AWS/CertificateManager namespace includes the following metric. CloudWatch metrics Version 1.0 168 AWS Certificate Manager User Guide Metric Description Unit Dimensions DaysToExpiry Number of days until a certificate expires. ACM stops publishin g this metric after a certificate expires. Integer CertificateArn • Value: ARN of the certificate For more information about CloudWatch metrics, see the following topics: • Using Amazon CloudWatch Metrics • Creating Amazon CloudWatch Alarms CloudWatch metrics Version 1.0 169 AWS Certificate Manager User Guide Use AWS Certificate Manager with the SDK for Java You can use the AWS Certificate Manager API to interact with the service programmatically by sending HTTP requests. For more information, see the AWS Certificate Manager API Reference. In addition to the web API (or HTTP API), you can use the AWS SDKs and command line tools to interact with ACM and other services. For more information, see Tools for Amazon Web Services. The following topics show you how to use one of the AWS SDKs, the AWS SDK for Java, to perform some of the available operations in the AWS Certificate Manager API. Topics • Adding tags to a certificate • Deleting a certificate • Describing a certificate • Exporting a certificate • Retrieve a certificate and certificate chain • Importing a certificate • Listing certificates • Renewing a certificate • Listing certificate tags • Removing tags from a certificate • Requesting a certificate • Resending validation email Adding tags to a certificate The following example shows how to use the AddTagsToCertificate function. package com.amazonaws.samples; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; AddTagsToCertificate Version 1.0 170 AWS Certificate Manager User Guide import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.model.ImportCertificateRequest; import com.amazonaws.services.certificatemanager.model.ImportCertificateResult; /** * This sample demonstrates how to use the ImportCertificate function in the AWS Certificate Manager * service. * * Input parameters: * Accesskey - AWS access key * SecretKey - AWS secret key * CertificateArn - Use to reimport a certificate (not included in this example). * region - AWS region * Certificate - PEM file that contains the certificate to import. Ex: /data/certs/ servercert.pem * CertificateChain - The certificate chain, not including the end-entity certificate. * PrivateKey - The private key that matches the public key in the certificate. * * Output parameter: * CertificcateArn - The ARN of the imported certificate. * */ public class AWSCertificateManagerSample { public static void main(String[] args) throws IOException { String accessKey = ""; String secretKey = ""; String certificateArn = null; Regions region = Regions.DEFAULT_REGION; String serverCertFilePath = ""; String privateKeyFilePath = ""; String caCertFilePath = ""; ImportCertificateRequest req = new ImportCertificateRequest() .withCertificate(getCertContent(serverCertFilePath)) .withPrivateKey(getCertContent(privateKeyFilePath)) .withCertificateChain(getCertContent(caCertFilePath)).withCertificateArn(certificateArn); AddTagsToCertificate Version 1.0 171 AWS Certificate Manager User Guide AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard().withRegion(region) .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey))) .build(); ImportCertificateResult result = client.importCertificate(req); System.out.println(result.getCertificateArn()); List<Tag> expectedTags = ImmutableList.of(Tag.builder().withKey("key").withValue("value").build()); AddTagsToCertificateRequest addTagsToCertificateRequest = AddTagsToCertificateRequest.builder() .withCertificateArn(result.getCertificateArn()) .withTags(tags) .build(); client.addTagsToCertificate(addTagsToCertificateRequest); } private static ByteBuffer getCertContent(String filePath) throws IOException { String fileContent = new String(Files.readAllBytes(Paths.get(filePath))); return StandardCharsets.UTF_8.encode(fileContent); } } Deleting a certificate The following example shows how to use the DeleteCertificate function. If successful, the function returns an empty set {}. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.DeleteCertificateRequest; import com.amazonaws.services.certificatemanager.model.DeleteCertificateResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; DeleteCertificate Version 1.0 172 AWS Certificate Manager User Guide import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceInUseException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; /** * This sample demonstrates how to use the DeleteCertificate function in the AWS Certificate * Manager service. * * Input parameter: * CertificateArn - The ARN of the certificate to delete. * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load the credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and specify the ARN of the certificate to delete. DeleteCertificateRequest req = new DeleteCertificateRequest(); DeleteCertificate Version 1.0 173 AWS Certificate Manager User Guide req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); // Delete the specified certificate. DeleteCertificateResult result = null; try { result = client.deleteCertificate(req); } catch (InvalidArnException ex) { throw ex; } catch (ResourceInUseException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } // Display the result. System.out.println(result); } } Describing a certificate The following example shows how to use the DescribeCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.DescribeCertificateRequest; import com.amazonaws.services.certificatemanager.model.DescribeCertificateResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; DescribeCertificate Version 1.0 174 AWS Certificate Manager User Guide import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; /** * This sample demonstrates |
acm-ug-059 | acm-ug.pdf | 59 | Certificate Manager User Guide req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); // Delete the specified certificate. DeleteCertificateResult result = null; try { result = client.deleteCertificate(req); } catch (InvalidArnException ex) { throw ex; } catch (ResourceInUseException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } // Display the result. System.out.println(result); } } Describing a certificate The following example shows how to use the DescribeCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.DescribeCertificateRequest; import com.amazonaws.services.certificatemanager.model.DescribeCertificateResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; DescribeCertificate Version 1.0 174 AWS Certificate Manager User Guide import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; /** * This sample demonstrates how to use the DescribeCertificate function in the AWS Certificate * Manager service. * * Input parameter: * CertificateArn - The ARN of the certificate to be described. * * Output parameter: * Certificate information * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load the credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and set the ARN of the certificate to be described. DescribeCertificateRequest req = new DescribeCertificateRequest(); DescribeCertificate Version 1.0 175 AWS Certificate Manager User Guide req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); DescribeCertificateResult result = null; try{ result = client.describeCertificate(req); } catch (InvalidArnException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } // Display the certificate information. System.out.println(result); } } If successful, the preceding example displays information similar to the following. { Certificate: { CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012, DomainName: www.example.com, SubjectAlternativeNames: [www.example.com], DomainValidationOptions: [{ DomainName: www.example.com, }], Serial: 10: 0a, Subject: C=US, ST=WA, L=Seattle, O=ExampleCompany, OU=sales, CN=www.example.com, Issuer: ExampleCompany, ImportedAt: FriOct0608: 17: 39PDT2017, DescribeCertificate Version 1.0 176 User Guide AWS Certificate Manager Status: ISSUED, NotBefore: ThuOct0510: 14: 32PDT2017, NotAfter: SunOct0310: 14: 32PDT2027, KeyAlgorithm: RSA-2048, SignatureAlgorithm: SHA256WITHRSA, InUseBy: [], Type: IMPORTED, } } Exporting a certificate The following example shows how to use the ExportCertificate function. The function exports a private certificate issued by a private certificate authority (CA) in the PKCS #8 format. (It is not possible to export public certificates whether they are ACM-issued or imported.) It also exports the certificate chain and private key. In the example, the passphrase for the key is stored in a local file. package com.amazonaws.samples; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ExportCertificateRequest; import com.amazonaws.services.certificatemanager.model.ExportCertificateResult; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.InvalidTagException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; ExportCertificate Version 1.0 177 AWS Certificate Manager User Guide public class ExportCertificate { public static void main(String[] args) throws Exception { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.your_region) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Initialize a file descriptor for the passphrase file. RandomAccessFile file_passphrase = null; // Initialize a buffer for the passphrase. ByteBuffer buf_passphrase = null; // Create a file stream for reading the private key passphrase. try { file_passphrase = new RandomAccessFile("C:\\Temp\\password.txt", "r"); } catch (IllegalArgumentException ex) { throw ex; } catch (SecurityException ex) { throw ex; } catch (FileNotFoundException ex) { throw ex; } // Create a channel to map the file. ExportCertificate Version 1.0 178 AWS Certificate Manager User Guide FileChannel channel_passphrase = file_passphrase.getChannel(); // Map the file to the buffer. try { buf_passphrase = channel_passphrase.map(FileChannel.MapMode.READ_ONLY, 0, channel_passphrase.size()); // Clean up after the file is mapped. channel_passphrase.close(); file_passphrase.close(); } catch (IOException ex) { throw ex; } // Create a request object. ExportCertificateRequest req = new ExportCertificateRequest(); // Set the certificate ARN. req.withCertificateArn("arn:aws:acm:region:account:" +"certificate/M12345678-1234-1234-1234-123456789012"); // Set the passphrase. req.withPassphrase(buf_passphrase); // Export the certificate. ExportCertificateResult result = null; try { result = client.exportCertificate(req); } catch(InvalidArnException ex) { throw ex; } catch (InvalidTagException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } ExportCertificate Version 1.0 179 AWS Certificate Manager User Guide // Clear the buffer. buf_passphrase.clear(); // Display the certificate and certificate chain. String certificate = result.getCertificate(); System.out.println(certificate); String certificate_chain = result.getCertificateChain(); System.out.println(certificate_chain); // This example retrieves but does not display the private key. String private_key = result.getPrivateKey(); } } Retrieve a certificate and certificate chain The following example shows how to use the GetCertificate function. package com.amazonaws.samples; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.GetCertificateRequest; import com.amazonaws.services.certificatemanager.model.GetCertificateResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.RequestInProgressException; import com.amazonaws.AmazonClientException; /** * This sample demonstrates how to use the GetCertificate function in the AWS Certificate * Manager service. * * Input parameter: GetCertificate Version 1.0 |
acm-ug-060 | acm-ug.pdf | 60 | Display the certificate and certificate chain. String certificate = result.getCertificate(); System.out.println(certificate); String certificate_chain = result.getCertificateChain(); System.out.println(certificate_chain); // This example retrieves but does not display the private key. String private_key = result.getPrivateKey(); } } Retrieve a certificate and certificate chain The following example shows how to use the GetCertificate function. package com.amazonaws.samples; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.GetCertificateRequest; import com.amazonaws.services.certificatemanager.model.GetCertificateResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.RequestInProgressException; import com.amazonaws.AmazonClientException; /** * This sample demonstrates how to use the GetCertificate function in the AWS Certificate * Manager service. * * Input parameter: GetCertificate Version 1.0 180 AWS Certificate Manager User Guide * CertificateArn - The ARN of the certificate to retrieve. * * Output parameters: * Certificate - A base64-encoded certificate in PEM format. * CertificateChain - The base64-encoded certificate chain in PEM format. * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load the credentials from the credential profiles file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and set the ARN of the certificate to be described. GetCertificateRequest req = new GetCertificateRequest(); req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); // Retrieve the certificate and certificate chain. // If you recently requested the certificate, loop until it has been created. GetCertificateResult result = null; long totalTimeout = 120000l; long timeSlept = 0l; long sleepInterval = 10000l; while (result == null && timeSlept < totalTimeout) { try { GetCertificate Version 1.0 181 AWS Certificate Manager User Guide result = client.getCertificate(req); } catch (RequestInProgressException ex) { Thread.sleep(sleepInterval); } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } timeSlept += sleepInterval; } // Display the certificate information. System.out.println(result); } } The preceding example creates output similar to the following. {Certificate: -----BEGIN CERTIFICATE----- base64-encoded certificate -----END CERTIFICATE-----, CertificateChain: -----BEGIN CERTIFICATE----- base64-encoded certificate chain -----END CERTIFICATE----- } Importing a certificate The following example shows how to use the ImportCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.auth.profile.ProfileCredentialsProvider; ImportCertificate Version 1.0 182 AWS Certificate Manager User Guide import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.model.ImportCertificateRequest; import com.amazonaws.services.certificatemanager.model.ImportCertificateResult; import com.amazonaws.services.certificatemanager.model.LimitExceededException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * This sample demonstrates how to use the ImportCertificate function in the AWS Certificate Manager * service. * * Input parameters: * Certificate - PEM file that contains the certificate to import. * CertificateArn - Use to reimport a certificate (not included in this example). * CertificateChain - The certificate chain, not including the end-entity certificate. * PrivateKey - The private key that matches the public key in the certificate. * * Output parameter: * CertificcateArn - The ARN of the imported certificate. * */ public class AWSCertificateManagerSample { public static void main(String[] args) throws Exception { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { ImportCertificate Version 1.0 183 AWS Certificate Manager User Guide throw new AmazonClientException( "Cannot load the credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Initialize the file descriptors. RandomAccessFile file_certificate = null; RandomAccessFile file_chain = null; RandomAccessFile file_key = null; // Initialize the buffers. ByteBuffer buf_certificate = null; ByteBuffer buf_chain = null; ByteBuffer buf_key = null; // Create the file streams for reading. try { file_certificate = new RandomAccessFile("C:\\Temp\\certificate.pem", "r"); file_chain = new RandomAccessFile("C:\\Temp\\chain.pem", "r"); file_key = new RandomAccessFile("C:\\Temp\\private_key.pem", "r"); } catch (IllegalArgumentException ex) { throw ex; } catch (SecurityException ex) { throw ex; } catch (FileNotFoundException ex) { throw ex; } // Create channels for mapping the files. FileChannel channel_certificate = file_certificate.getChannel(); FileChannel channel_chain = file_chain.getChannel(); FileChannel channel_key = file_key.getChannel(); // Map the files to buffers. try { ImportCertificate Version 1.0 184 AWS Certificate Manager User Guide buf_certificate = channel_certificate.map(FileChannel.MapMode.READ_ONLY, 0, channel_certificate.size()); buf_chain = channel_chain.map(FileChannel.MapMode.READ_ONLY, 0, channel_chain.size()); buf_key = channel_key.map(FileChannel.MapMode.READ_ONLY, 0, channel_key.size()); // The files have been mapped, so clean up. channel_certificate.close(); channel_chain.close(); channel_key.close(); file_certificate.close(); file_chain.close(); file_key.close(); } catch (IOException ex) { throw ex; } // Create a request object and set the parameters. ImportCertificateRequest req = new ImportCertificateRequest(); req.setCertificate(buf_certificate); req.setCertificateChain(buf_chain); req.setPrivateKey(buf_key); // Import the certificate. ImportCertificateResult result = null; try { result = client.importCertificate(req); } catch(LimitExceededException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } // Clear the buffers. buf_certificate.clear(); buf_chain.clear(); buf_key.clear(); ImportCertificate Version 1.0 185 AWS Certificate Manager User Guide // Retrieve and display the certificate ARN. String arn = result.getCertificateArn(); System.out.println(arn); } } Listing certificates The following example shows how |
acm-ug-061 | acm-ug.pdf | 61 | been mapped, so clean up. channel_certificate.close(); channel_chain.close(); channel_key.close(); file_certificate.close(); file_chain.close(); file_key.close(); } catch (IOException ex) { throw ex; } // Create a request object and set the parameters. ImportCertificateRequest req = new ImportCertificateRequest(); req.setCertificate(buf_certificate); req.setCertificateChain(buf_chain); req.setPrivateKey(buf_key); // Import the certificate. ImportCertificateResult result = null; try { result = client.importCertificate(req); } catch(LimitExceededException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } // Clear the buffers. buf_certificate.clear(); buf_chain.clear(); buf_key.clear(); ImportCertificate Version 1.0 185 AWS Certificate Manager User Guide // Retrieve and display the certificate ARN. String arn = result.getCertificateArn(); System.out.println(arn); } } Listing certificates The following example shows how to use the ListCertificates function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ListCertificatesRequest; import com.amazonaws.services.certificatemanager.model.ListCertificatesResult; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.AmazonClientException; import java.util.Arrays; import java.util.List; /** * This sample demonstrates how to use the ListCertificates function in the AWS Certificate * Manager service. * * Input parameters: * CertificateStatuses - An array of strings that contains the statuses to use for filtering. * MaxItems - The maximum number of certificates to return in the response. * NextToken - Use when paginating results. * * Output parameters: * CertificateSummaryList - A list of certificates. * NextToken - Use to show additional results when paginating a truncated list. * ListCertificates Version 1.0 186 AWS Certificate Manager */ User Guide public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load the credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and set the parameters. ListCertificatesRequest req = new ListCertificatesRequest(); List<String> Statuses = Arrays.asList("ISSUED", "EXPIRED", "PENDING_VALIDATION", "FAILED"); req.setCertificateStatuses(Statuses); req.setMaxItems(10); // Retrieve the list of certificates. ListCertificatesResult result = null; try { result = client.listCertificates(req); } catch (Exception ex) { throw ex; } // Display the certificate list. System.out.println(result); } ListCertificates Version 1.0 187 AWS Certificate Manager } User Guide The preceding sample creates output similar to the following. { CertificateSummaryList: [{ CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012, DomainName: www.example1.com }, { CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012, DomainName: www.example2.com }, { CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012, DomainName: www.example3.com }] } Renewing a certificate The following example shows how to use the RenewCertificate function. The function renews a private certificate issued by a private certificate authority (CA) and exported with the ExportCertificate function. At this time, only exported private certificates can be renewed with this function. In order to renew your AWS Private CA certificates with ACM, you must first grant the ACM service principal permissions to do so. For more information, see Assigning Certificate Renewal Permissions to ACM. package com.amazonaws.samples; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; RenewCertificate Version 1.0 188 AWS Certificate Manager User Guide import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.RenewCertificateRequest; import com.amazonaws.services.certificatemanager.model.RenewCertificateResult; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.ValidationException; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class RenewCertificate { public static void main(String[] args) throws Exception { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.your_region) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and specify the ARN of the certificate to renew. RenewCertificateRequest req = new RenewCertificateRequest(); req.withCertificateArn("arn:aws:acm:region:account:" +"certificate/M12345678-1234-1234-1234-123456789012"); RenewCertificate Version 1.0 189 AWS Certificate Manager User Guide // Renew the certificate. RenewCertificateResult result = null; try { result = client.renewCertificate(req); } catch(InvalidArnException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (ValidationException ex) { throw ex; } // Display the result. System.out.println(result); } } Listing certificate tags The following example shows how to use the ListTagsForCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ListTagsForCertificateRequest; import com.amazonaws.services.certificatemanager.model.ListTagsForCertificateResult; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.regions.Regions; ListTagsForCertificate Version 1.0 190 AWS Certificate Manager User Guide /** * This sample demonstrates how to use the ListTagsForCertificate function in the AWS Certificate * Manager service. * * Input parameter: * CertificateArn - The ARN of the certificate whose tags you want to list. * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and specify the ARN of the certificate. ListTagsForCertificateRequest |
acm-ug-062 | acm-ug.pdf | 62 | Manager service. * * Input parameter: * CertificateArn - The ARN of the certificate whose tags you want to list. * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and specify the ARN of the certificate. ListTagsForCertificateRequest req = new ListTagsForCertificateRequest(); req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); // Create a result object. ListTagsForCertificateResult result = null; try { result = client.listTagsForCertificate(req); ListTagsForCertificate Version 1.0 191 User Guide AWS Certificate Manager } catch(InvalidArnException ex) { throw ex; } catch(ResourceNotFoundException ex) { throw ex; } // Display the result. System.out.println(result); } } The preceding sample creates output similar to the following. {Tags: [{Key: Purpose,Value: Test}, {Key: Short_Name,Value: My_Cert}]} Removing tags from a certificate The following example shows how to use the RemoveTagsFromCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.RemoveTagsFromCertificateRequest; import com.amazonaws.services.certificatemanager.model.RemoveTagsFromCertificateResult; import com.amazonaws.services.certificatemanager.model.Tag; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.InvalidTagException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import java.util.ArrayList; RemoveTagsFromCertificate Version 1.0 192 AWS Certificate Manager User Guide /** * This sample demonstrates how to use the RemoveTagsFromCertificate function in the AWS Certificate * Manager service. * * Input parameters: * CertificateArn - The ARN of the certificate from which you want to remove one or more tags. * Tags - A collection of key-value pairs that specify which tags to remove. * */ public class AWSCertificateManagerExample { public static void main(String[] args) throws Exception { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Specify the tags to remove. Tag tag1 = new Tag(); tag1.setKey("Short_Name"); tag1.setValue("My_Cert"); Tag tag2 = new Tag() .withKey("Purpose") .withValue("Test"); RemoveTagsFromCertificate Version 1.0 193 AWS Certificate Manager User Guide // Add the tags to a collection. ArrayList<Tag> tags = new ArrayList<Tag>(); tags.add(tag1); tags.add(tag2); // Create a request object. RemoveTagsFromCertificateRequest req = new RemoveTagsFromCertificateRequest(); req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); req.setTags(tags); // Create a result object. RemoveTagsFromCertificateResult result = null; try { result = client.removeTagsFromCertificate(req); } catch(InvalidArnException ex) { throw ex; } catch(InvalidTagException ex) { throw ex; } catch(ResourceNotFoundException ex) { throw ex; } // Display the result. System.out.println(result); } } Requesting a certificate The following example shows how to use the RequestCertificate function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; RequestCertificate Version 1.0 194 AWS Certificate Manager User Guide import com.amazonaws.services.certificatemanager.model.RequestCertificateRequest; import com.amazonaws.services.certificatemanager.model.RequestCertificateResult; import com.amazonaws.services.certificatemanager.model.InvalidDomainValidationOptionsException; import com.amazonaws.services.certificatemanager.model.LimitExceededException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import java.util.ArrayList; /** * This sample demonstrates how to use the RequestCertificate function in the AWS Certificate * Manager service. * * Input parameters: * DomainName - FQDN of your site. * DomainValidationOptions - Domain name for email validation. * IdempotencyToken - Distinguishes between calls to RequestCertificate. * SubjectAlternativeNames - Additional FQDNs for the subject alternative names extension. * * Output parameter: * Certificate ARN - The Amazon Resource Name (ARN) of the certificate you requested. * */ public class AWSCertificateManagerExample { public static void main(String[] args) { // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { RequestCertificate Version 1.0 195 AWS Certificate Manager User Guide throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Specify a SAN. ArrayList<String> san = new ArrayList<String>(); san.add("www.example.com"); // Create a request object and set the input parameters. RequestCertificateRequest req = new RequestCertificateRequest(); req.setDomainName("example.com"); req.setIdempotencyToken("1Aq25pTy"); req.setSubjectAlternativeNames(san); // Create a result object and display the certificate ARN. RequestCertificateResult result = null; try { result = client.requestCertificate(req); } catch(InvalidDomainValidationOptionsException ex) { throw ex; } catch(LimitExceededException ex) { throw ex; } // Display the ARN. System.out.println(result); } } The preceding sample creates output similar to the following. RequestCertificate Version 1.0 196 AWS Certificate Manager User Guide {CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012} Resending validation email The following example shows you how to use the ResendValidationEmail function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailRequest; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailResult; import com.amazonaws.services.certificatemanager.model.InvalidDomainValidationOptionsException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.InvalidStateException; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; /** * This sample demonstrates how to use the ResendValidationEmail function in the AWS Certificate * Manager service. * * Input parameters: * CertificateArn - Amazon Resource Name (ARN) of the certificate request. * Domain - FQDN |
acm-ug-063 | acm-ug.pdf | 63 | } The preceding sample creates output similar to the following. RequestCertificate Version 1.0 196 AWS Certificate Manager User Guide {CertificateArn: arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012} Resending validation email The following example shows you how to use the ResendValidationEmail function. package com.amazonaws.samples; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailRequest; import com.amazonaws.services.certificatemanager.model.ResendValidationEmailResult; import com.amazonaws.services.certificatemanager.model.InvalidDomainValidationOptionsException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.InvalidStateException; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; /** * This sample demonstrates how to use the ResendValidationEmail function in the AWS Certificate * Manager service. * * Input parameters: * CertificateArn - Amazon Resource Name (ARN) of the certificate request. * Domain - FQDN in the certificate request. * ValidationDomain - The base validation domain that is used to send email. * */ public class AWSCertificateManagerExample { public static void main(String[] args) { ResendValidationEmail Version 1.0 197 AWS Certificate Manager User Guide // Retrieve your credentials from the C:\Users\name\.aws\credentials file in Windows // or the ~/.aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and set the input parameters. ResendValidationEmailRequest req = new ResendValidationEmailRequest(); req.setCertificateArn("arn:aws:acm:region:account:certificate/ 12345678-1234-1234-1234-123456789012"); req.setDomain("gregpe.io"); req.setValidationDomain("gregpe.io"); // Create a result object. ResendValidationEmailResult result = null; try { result = client.resendValidationEmail(req); } catch(ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidDomainValidationOptionsException ex) ResendValidationEmail Version 1.0 198 User Guide AWS Certificate Manager { throw ex; } // Display the result. System.out.println(result.toString()); } } The preceding sample resends your validation email and displays an empty set. ResendValidationEmail Version 1.0 199 AWS Certificate Manager User Guide Troubleshoot issues with AWS Certificate Manager Consult the following topics if you encounter problems using AWS Certificate Manager. Note If you don't see your issue addressed in this section, we recommend visiting the AWS Knowledge Center. Topics • Troubleshoot certificate requests • Troubleshoot certificate validation • Troubleshoot managed certificate renewal • Troubleshoot other problems • Handling exceptions Troubleshoot certificate requests Consult the following topics if you encounter problems when requesting an ACM certificate. Topics • Certificate request times out • Certificate request fails Certificate request times out Requests for ACM certificates time out if they are not validated within 72 hours. To correct this condition, open the console, find the record for the certificate, click the checkbox for it, choose Actions, and choose Delete. Then choose Actions and Request a certificate to begin again. For more information, see AWS Certificate Manager DNS validation or AWS Certificate Manager email validation. We recommend that you use DNS validation if possible. Certificate requests Version 1.0 200 AWS Certificate Manager Certificate request fails User Guide If your request fails ACM and you receive one of the following error messages, follow the suggested steps to fix the problem. You cannot resubmit a failed certificate request – after resolving the problem, submit a new request. Topics • Error message: No Available Contacts • Error message: Additional Verification Required • Error message: Invalid Public Domain • Error message: Other Error message: No Available Contacts You chose email validation when requesting a certificate, but ACM could not find an email address to use for validating one or more of the domain names in the request. To correct this problem, you can do one of the following: • Ensure your domain is configured to receive email. Your domain's name server must have a mail exchanger record (MX record) so ACM's email servers know where to send the domain validation email. Accomplishing just one of the preceding tasks is enough to correct this problem; you don't need to do both. After you correct the problem, request a new certificate. For more information about how to ensure that you receive domain validation emails from ACM, see AWS Certificate Manager email validation or Not receiving validation email. If you follow these steps and continue to get the No Available Contacts message, then report this to AWS so that we can investigate it. Error message: Additional Verification Required ACM requires additional information to process this certificate request. This happens as a fraud- protection measure if your domain ranks within the Alexa top 1000 websites. To provide the required information, use the Support Center to contact Support. If you don't have a support plan, post a new thread in the ACM Discussion Forum. Request fails Version 1.0 201 AWS Certificate Manager Note User Guide You cannot request a certificate for Amazon-owned domain names such as those ending in amazonaws.com, cloudfront.net, or elasticbeanstalk.com. Error message: Invalid Public Domain One or more of the domain names in the certificate request is not valid. Typically, this is because a domain name in the request is not a |
acm-ug-064 | acm-ug.pdf | 64 | measure if your domain ranks within the Alexa top 1000 websites. To provide the required information, use the Support Center to contact Support. If you don't have a support plan, post a new thread in the ACM Discussion Forum. Request fails Version 1.0 201 AWS Certificate Manager Note User Guide You cannot request a certificate for Amazon-owned domain names such as those ending in amazonaws.com, cloudfront.net, or elasticbeanstalk.com. Error message: Invalid Public Domain One or more of the domain names in the certificate request is not valid. Typically, this is because a domain name in the request is not a valid top-level domain. Try again to request a certificate, correcting any spelling errors or typos that were in the failed request, and ensure that all domain names in the request are for valid top-level domains. For example, you cannot request an ACM certificate for example.invalidpublicdomain because "invalidpublicdomain" is not a valid top-level domain. If you continue to receive this failure reason, contact the Support Center. If you don't have a support plan, post a new thread in the ACM Discussion Forum. Error message: Other Typically, this failure occurs when there is a typographical error in one or more of the domain names in the certificate request. Try again to request a certificate, correcting any spelling errors or typos that were in the failed request. If you continue to receive this failure message, use the Support Center to contact Support. If you don't have a support plan, post a new thread in the ACM Discussion Forum. Troubleshoot certificate validation If the ACM certificate request status is Pending validation, the request is waiting for action from you. If you chose email validation when you made the request, you or an authorized representative must respond to the validation email messages. These messages were sent to the common email addresses for the requested domain. For more information, see AWS Certificate Manager email validation. If you chose DNS validation, you must write the CNAME record that ACM created for you to your DNS database. For more information, see AWS Certificate Manager DNS validation. Important You must validate that you own or control every domain name that you included in your certificate request. If you chose email validation, you will receive validation email messages Certificate validation Version 1.0 202 AWS Certificate Manager User Guide for each domain. If you do not, then see Not receiving validation email. If you chose DNS validation, you must create one CNAME record for each domain. Note Public ACM certificates can be installed on Amazon EC2 instances that are connected to a Nitro Enclave, but not to other Amazon EC2 instances. For information about setting up a standalone web server on an Amazon EC2 instance not connected to a Nitro Enclave, see Tutorial: Install a LAMP web server on Amazon Linux 2 or Tutorial: Install a LAMP web server with the Amazon Linux AMI. We recommend that you use DNS validation rather than email validation. Consult the following topics if you experience validation problems. Topics • Troubleshoot DNS validation problems • Troubleshoot email validation problems • Troubleshooting HTTP validation problems Troubleshoot DNS validation problems Consult the following guidance if you are having trouble validating a certificate with DNS. The first step in DNS troubleshooting is to check the current status of your domain with tools such as the following: • dig — Linux, Windows • nslookup — Linux, Windows Topics • Underscores prohibited by DNS provider • Default trailing period added by DNS provider • DNS validation on GoDaddy fails DNS validation Version 1.0 203 AWS Certificate Manager User Guide • ACM Console does not display "Create records in Route 53" button • Route 53 validation fails on private (untrusted) domains • Validation is successful but issuance or renewal fails • Validation fails for DNS server on a VPN Underscores prohibited by DNS provider If your DNS provider prohibits leading underscores in CNAME values, you can remove the underscore from the ACM-provided value and validate your domain without it. For example, the CNAME value _x2.acm-validations.aws can be changed to x2.acm-validations.aws for validation purposes. However, the CNAME name parameter must always begin with a leading underscore. You can use either of the values on the right side of the table below to validate a domain. Name Type Value _<random value>.ex CNAME _<random value>.acm-validat ample.com. ions.aws. _<random value>.ex CNAME <random value>.acm-validat ample.com. ions.aws. Default trailing period added by DNS provider Some DNS providers add by default a trailing period to the CNAME value that you provide. As a result, adding the period yourself causes an error. For example, "<random_value>.acm- validations.aws." is rejected while "<random_value>.acm-validations.aws" is accepted. DNS validation on GoDaddy fails DNS validation for domains registered with Godaddy and other registries may fail unless you modify the CNAME values provided by ACM. Taking |
acm-ug-065 | acm-ug.pdf | 65 | values on the right side of the table below to validate a domain. Name Type Value _<random value>.ex CNAME _<random value>.acm-validat ample.com. ions.aws. _<random value>.ex CNAME <random value>.acm-validat ample.com. ions.aws. Default trailing period added by DNS provider Some DNS providers add by default a trailing period to the CNAME value that you provide. As a result, adding the period yourself causes an error. For example, "<random_value>.acm- validations.aws." is rejected while "<random_value>.acm-validations.aws" is accepted. DNS validation on GoDaddy fails DNS validation for domains registered with Godaddy and other registries may fail unless you modify the CNAME values provided by ACM. Taking example.com as the domain name, the issued CNAME record has the following form: NAME: _ho9hv39800vb3examplew3vnewoib3u.example.com. VALUE: _cjhwou20vhu2exampleuw20vuyb2ovb9.j9s73ucn9vy.acm-validations.aws. DNS validation Version 1.0 204 AWS Certificate Manager User Guide You can create a CNAME record compatible with GoDaddy by truncating the apex domain (including the period) at the end of the NAME field, as follows: NAME: _ho9hv39800vb3examplew3vnewoib3u VALUE: _cjhwou20vhu2exampleuw20vuyb2ovb9.j9s73ucn9vy.acm-validations.aws. ACM Console does not display "Create records in Route 53" button If you select Amazon Route 53 as your DNS provider, AWS Certificate Manager can interact directly with it to validate your domain ownership. Under some circumstances, the console's Create records in Route 53 button may not be available when you expect it. If this happens, check for the following possible causes. • You are not using Route 53 as your DNS provider. • You are logged into ACM and Route 53 through different accounts. • You lack IAM permissions to create records in a zone hosted by Route 53. • You or someone else has already validated the domain. • The domain is not publicly addressable. Route 53 validation fails on private (untrusted) domains During DNS validation, ACM searches for a CNAME in a publicly hosted zone. When it doesn't find one, it times out after 72 hours with a status of Validation timed out. You cannot use it to host DNS records for private domains, including resources in an Amazon VPC private hosted zone, untrusted domains in your private PKI, and self-signed certificates. AWS does provide support for publicly untrusted domains through the AWS Private CA service. Validation is successful but issuance or renewal fails If certificate issuance fails with "Pending validation" even though DNS is correct, check that issuance is not being blocked by a Certification Authority Authorization (CAA) record. For more information, see (Optional) Configure a CAA record. Validation fails for DNS server on a VPN If you locate a DNS server on a VPN and ACM fails to validate a certificate against it, check if the server is publicly accessible. Public certificate issuance using ACM DNS validation requires that the domain records be resolvable over the public internet. DNS validation Version 1.0 205 AWS Certificate Manager User Guide Troubleshoot email validation problems Consult the following guidance if you are having trouble validating a certificate domain with email. Topics • Not receiving validation email • Persistent initial timestamp for email validation • I can't switch to DNS validation Not receiving validation email When you request a certificate from ACM and choose email validation, domain validation email is sent to the five common administrative addresses. For more information, see AWS Certificate Manager email validation. If you are experiencing problems receiving validation email, review the suggestions that follow. Where to look for email ACM sends validation email messages to your requested domain name. You can also specify a superdomain as a validation domain if you wish to receive these emails at that domain instead. Any subdomain up to the minimal website address is valid, and is used as the domain for the email address as the suffix after @. For example, you can receive an email to admin@example.com if you specify example.com as the validation domain for subdomain.example.com. Review the list of email addresses that are displayed in the ACM console (or returned from the CLI or API) to determine where you should be looking for validation email. To see the list, click the icon next to the domain name in the box labeled Validation not complete. The email is marked as spam Check your spam folder for the validation email. GMail automatically sorts your email If you are using GMail, the validation email may have been automatically sorted into the Updates or Promotions tabs. The domain registrar does not display contact information or privacy protection is enabled For domains purchased from Route 53, privacy protection is enabled by default and your email address is mapped to a whoisprivacyservice.org, contact.gandi.net, or identity- Email validation Version 1.0 206 AWS Certificate Manager User Guide protect.org email address. Ensure that your registrant email address on file with your domain registrar is up to date so that the email sent to these obscured email addresses can be forwarded to an email address that you control. |
acm-ug-066 | acm-ug.pdf | 66 | the validation email may have been automatically sorted into the Updates or Promotions tabs. The domain registrar does not display contact information or privacy protection is enabled For domains purchased from Route 53, privacy protection is enabled by default and your email address is mapped to a whoisprivacyservice.org, contact.gandi.net, or identity- Email validation Version 1.0 206 AWS Certificate Manager User Guide protect.org email address. Ensure that your registrant email address on file with your domain registrar is up to date so that the email sent to these obscured email addresses can be forwarded to an email address that you control. Note Privacy protection for some domains that your purchase with Route 53 will be enabled even if you choose to make your contact information public. For example, privacy protection for the .ca top level domain cannot be programmatically disabled by Route 53. You must contact the AWS Support Center and request that privacy protection be disabled. After making available at least one of the eight email addresses to which AWS sends validation email and confirming that you can receive email for that address, you are ready to request a certificate through ACM. After you make a certificate request, ensure the intended email address appears in the list of email addresses in the AWS Management Console. While the certificate is in the Pending validation state, you can expand the list to view it by clicking the icon next to the domain name in the box labeled Validation not complete. You can also view the list in Step 3: Validate of the ACM Request a Certificate wizard. The listed email addresses are the ones to which email was sent. Contact the Support Center If, after reviewing the preceding guidance, you still don't receive the domain validation email, please visit the Support Center and create a case. If you don't have a support agreement, post a message to the ACM Discussion Forum. Persistent initial timestamp for email validation The timestamp of a certificate's first email-validation request persists through later requests for validation renewal. This is not evidence of an error in ACM operations. I can't switch to DNS validation After you create a certificate with email validation, you cannot switch to validating it with DNS. To use DNS validation, delete the certificate and then create a new one that uses DNS validation. Email validation Version 1.0 207 AWS Certificate Manager User Guide Troubleshooting HTTP validation problems Consult the following guidance if you're having trouble validating a certificate with HTTP. The first step in HTTP troubleshooting is to check the current status of your domain with tools such as the following: • curl — Linux and Windows • wget — Linux and Windows Topics • Content mismatch between RedirectFrom and RedirectTo locations • Incorrect CloudFront configuration • HTTP redirect issues • Validation timeout Content mismatch between RedirectFrom and RedirectTo locations If the content at the RedirectFrom location doesn't match the content at the RedirectTo location, validation will fail. Ensure that the content is identical for each domain in the certificate. Incorrect CloudFront configuration Make sure your CloudFront distribution is correctly configured to serve the validation content. Check that the origin and behavior settings are correct and that the distribution is deployed. HTTP redirect issues If you're using a redirect instead of serving the content directly, follow these steps to verify your configuration. To verify redirect configuration 1. Copy the RedirectFrom URL and paste it into your browser's address bar. 2. In a new browser tab, paste the RedirectTo URL. 3. Compare the content at both URLs to ensure they match exactly. HTTP validation Version 1.0 208 AWS Certificate Manager User Guide 4. Verify that the redirect returns a 302 status code. Validation timeout HTTP validation may time out if the content isn't available within the expected time frame. To troubleshoot validation issues, follow these steps. To troubleshoot validation timeout 1. Do one of the following to check which domains are pending validation: a. Open the ACM console and view the certificate details page. Look for domains marked as Pending validation. b. Call the DescribeCertificate API operation to view the validation status of each domain. 2. For each pending domain, verify that the validation content is accessible from the internet. Troubleshoot managed certificate renewal ACM tries to automatically renew your ACM certificates before they expire so that no action is required from you. Consult the following topics if you have trouble with Managed certificate renewal in AWS Certificate Manager. Preparing for automatic domain validation Before ACM can renew your certificates automatically, the following must be true: • Your certificate must be associated with an AWS service that is integrated with ACM. For information about the resources that ACM supports, see Services integrated with ACM. • For email-validated certificates, ACM must be able to reach you |
acm-ug-067 | acm-ug.pdf | 67 | is accessible from the internet. Troubleshoot managed certificate renewal ACM tries to automatically renew your ACM certificates before they expire so that no action is required from you. Consult the following topics if you have trouble with Managed certificate renewal in AWS Certificate Manager. Preparing for automatic domain validation Before ACM can renew your certificates automatically, the following must be true: • Your certificate must be associated with an AWS service that is integrated with ACM. For information about the resources that ACM supports, see Services integrated with ACM. • For email-validated certificates, ACM must be able to reach you at an administrator email address for each domain listed in your certificate. The email addresses that will be tried are listed in AWS Certificate Manager email validation. • For DNS-validated certificates, make sure that your DNS configuration contains the correct CNAME records as described in AWS Certificate Manager DNS validation. • For HTTP-validated certificates, make sure that your redirects are configured as described in AWS Certificate Manager HTTP validation. Certificate renewal Version 1.0 209 AWS Certificate Manager User Guide Handling failures in managed certificate renewal As the certificate nears expiration (60 days for DNS, 45 for EMAIL and 60 days for Private), ACM attempts to renew the certificate if it meets the eligibility criteria. You might have to take actions for the renewal to succeed. For more information, see Managed certificate renewal in AWS Certificate Manager. Managed certificate renewal for email-validated certificates ACM certificates are valid for 13 months (395 days). Renewing a certificate requires action by the domain owner. ACM begins sending renewal notices to the email addresses associated with the domain 45 days before expiration. The notifications contain a link that the domain owner can click for renewal. Once all listed domains are validated, ACM issues a renewed certificate with the same ARN. See Validate with Email for instructions on identifying which domains are in the PENDING_VALIDATION state and repeating the validation process for those domains. Managed certificate renewal for DNS-validated certificates ACM does not attempt TLS validation for DNS-validated certificates. If ACM fails to renew a certificate you validated with DNS validation, it is most likely due to missing or inaccurate CNAME records in your DNS configuration. If this occurs, ACM notifies you that the certificate could not be renewed automatically. Important You must insert the correct CNAME records into your DNS database. Consult your domain registrar about how to do this. You can find the CNAME records for your domains by expanding your certificate and its domain entries in the ACM console. Refer to the figures below for details. You can also retrieve CNAME records by using the DescribeCertificate operation in the ACM API or the describe-certificate command in the ACM CLI. For more information, see AWS Certificate Manager DNS validation. Handling failures in managed certificate renewal Version 1.0 210 AWS Certificate Manager User Guide Choose the target certificate from the console. Managed certificate renewal for DNS-validated certificates Version 1.0 211 AWS Certificate Manager User Guide Expand the certificate window to find the certificate's CNAME information. If the problem persists, contact the Support Center. Managed certificate renewal for HTTP-validated certificates ACM attempts to renew HTTP-validated certificates automatically. If renewal fails, it's likely due to issues with the HTTP validation records. In such cases, ACM notifies you that the certificate couldn't be renewed automatically. Important You must ensure that the content at the RedirectFrom location matches the content at the RedirectTo location for each domain in the certificate. You can find the HTTP validation information for your domains by expanding your certificate and its domain entries in the ACM console. You can also retrieve this information using the Managed certificate renewal for HTTP-validated certificates Version 1.0 212 AWS Certificate Manager User Guide DescribeCertificate operation in the ACM API or the describe-certificate command in the ACM CLI. For more information, see AWS Certificate Manager HTTP validation. If the problem persists, contact the Support Center. Understanding renewal timing Managed certificate renewal in AWS Certificate Manager is an asynchronous process. This means that the steps don't occur in immediate succession. After all domain names in an ACM certificate have been validated, there might be a delay before ACM obtains the new certificate. An additional delay can occur between the time when ACM obtains the renewed certificate and the time when that certificate is deployed to the AWS resources that use it. Therefore, changes to the certificate status can take up to several hours to appear in the console. Troubleshoot other problems This section includes guidance for problems not related to issuing or validating ACM certificates. Topics • Certification Authority Authorization (CAA) problems • Certificate import problems • Certificate pinning problems • API Gateway problems • What to do when a working certificate fails unexpectedly • Problems with the ACM service-linked |
acm-ug-068 | acm-ug.pdf | 68 | new certificate. An additional delay can occur between the time when ACM obtains the renewed certificate and the time when that certificate is deployed to the AWS resources that use it. Therefore, changes to the certificate status can take up to several hours to appear in the console. Troubleshoot other problems This section includes guidance for problems not related to issuing or validating ACM certificates. Topics • Certification Authority Authorization (CAA) problems • Certificate import problems • Certificate pinning problems • API Gateway problems • What to do when a working certificate fails unexpectedly • Problems with the ACM service-linked role (SLR) Certification Authority Authorization (CAA) problems You can use CAA DNS records to specify that the Amazon certificate authority (CA) can issue ACM certificates for your domain or subdomain. If you receive an error during certificate issuance that says One or more domain names have failed validation due to a Certification Authority Authorization (CAA) error, check your CAA DNS records. If you receive this error after your ACM certificate request has been successfully validated, you must update your CAA records and request a certificate again. The value field in your CAA record must contain one of the following domain names: • amazon.com Understanding renewal timing Version 1.0 213 AWS Certificate Manager • amazontrust.com • awstrust.com • amazonaws.com User Guide For more information about creating a CAA record, see (Optional) Configure a CAA record. Note You can choose to not configure a CAA record for your domain if you do not want to enable CAA checking. Certificate import problems You can import third-party certificates into ACM and associate them with integrated services. If you encounter problems, review the prerequisites and certificate format topics. In particular, note the following: • You can import only X.509 version 3 SSL/TLS certificates. • Your certificate can be self–signed or it can be signed by a certificate authority (CA). • If your certificate is signed by a CA, you must include an intermediate certificate chain that provides a path to the root of authority. • If your certificate is self-signed, you must include the private key in plaintext. • Each certificate in the chain must directly certify the one preceding. • Do not include your end-entity certificate in the intermediate certificate chain. • Your certificate, certificate chain, and private key (if any) must be PEM–encoded. In general, PEM encoding consists of blocks of Base64-encoded ASCII text that begin and end with plaintext header and footer lines. You must not add lines or spaces or make any other changes to a PEM file while copying or uploading it. You can verify certificate chains using the OpenSSL verify utility. • Your private key (if any) must not be encrypted. (Tip: if it has a passphrase, it's encrypted.) • Services integrated with ACM must use ACM-supported algorithms and key sizes. See the AWS Certificate Manager User Guide and the documentation for each service to make sure that your certificate will work. Certificate import Version 1.0 214 AWS Certificate Manager User Guide • Certificate support by integrated services might differ depending on whether the certificate is imported into IAM or into ACM. • The certificate must be valid when it is imported. • Detail information for all of your certificates is displayed in the console. By default, however, if you call the ListCertificates API or the list-certificates AWS CLI command without specifying the keyTypes filter, only RSA_1024 or RSA_2048 certificates are displayed. Certificate pinning problems To renew a certificate, ACM generates a new public-private key pair. If your application uses Certificate pinning, sometimes known as SSL pinning, to pin an ACM certificate, the application might not be able to connect to your domain after AWS renews the certificate. For this reason, we recommend that you don't pin an ACM certificate. If your application must pin a certificate, you can do the following: • Import your own certificate into ACM and then pin your application to the imported certificate. ACM doesn't provide managed renewal for imported certificates. • If you're using a public certificate, pin your application to all available Amazon root certificates. If you're using a private certificate, pin your application to the CA's root certificate. API Gateway problems When you deploy an edge-optimized API endpoint, API Gateway sets up a CloudFront distribution for you. The CloudFront distribution is owned by API Gateway, not by your account. The distribution is bound to the ACM certificate that you used when deploying your API. To remove the binding and allow ACM to delete your certificate, you must remove the API Gateway custom domain that is associated with the certificate. When you deploy a regional API endpoint, API Gateway creates an application load balancer (ALB) on your behalf. The load balancer is owned by API Gateway and is not visible to you. |
acm-ug-069 | acm-ug.pdf | 69 | When you deploy an edge-optimized API endpoint, API Gateway sets up a CloudFront distribution for you. The CloudFront distribution is owned by API Gateway, not by your account. The distribution is bound to the ACM certificate that you used when deploying your API. To remove the binding and allow ACM to delete your certificate, you must remove the API Gateway custom domain that is associated with the certificate. When you deploy a regional API endpoint, API Gateway creates an application load balancer (ALB) on your behalf. The load balancer is owned by API Gateway and is not visible to you. The ALB is bound to the ACM certificate that you used when deploying your API. To remove the binding and allow ACM to delete your certificate, you must remove the API Gateway custom domain that is associated with the certificate. Certificate pinning Version 1.0 215 AWS Certificate Manager User Guide What to do when a working certificate fails unexpectedly If you have successfully associated an ACM certificate with an integrated service, but the certificate stops working and the integrated service begins returning errors, the cause may be a change in the permissions that the service needs in order to use an ACM certificate. For example, Elastic Load Balancing (ELB) requires permission to decrypt an AWS KMS key that, in turn, decrypts the certificate's private key. This permission is granted by a resource-based policy that ACM applies when you associate a certificate with ELB. If ELB loses the grant for that permission, it will fail the next time it attempts to decrypt the certificate key. To investigate the problem, check the status of your grants using the AWS KMS console at https:// console.aws.amazon.com/kms. Then take one of the following actions: • If you believe that permissions granted to an integrated service have been revoked, visit the integrated service's console, disassociate the certificate from the service, then re-associate it. This will reapply the resource-based policy and put a new grant in place. • If you believe that permissions granted to ACM have been revoked, contact Support at https:// console.aws.amazon.com/support/home#/. Problems with the ACM service-linked role (SLR) When you issue a certificate signed by a private CA that has been shared with you by another account, ACM attempts on first use to set up a service-linked role (SLR) to interact as a principal with an AWS Private CA resource-based access policy. If you issue a private certificate from a shared CA and the SLR is not in place, ACM will be unable to automatically renew that certificate for you. ACM might alert you that it cannot determine whether an SLR exists on your account. If the required iam:GetRole permission has already been granted to the ACM SLR for your account, then the alert will not recur after the SLR is created. If it does recur, then you or your account administrator might need to grant the iam:GetRole permission to ACM, or associate your account with the ACM-managed policy AWSCertificateManagerFullAccess. For more information, see Service-Linked Role Permissions in the IAM User Guide. Handling exceptions An AWS Certificate Manager command might fail for several reasons. For information about each exception, see the table below. Unexpected failure Version 1.0 216 AWS Certificate Manager User Guide Private certificate exception handling The following exceptions can occur when you attempt to renew a private PKI certificate issued by AWS Private CA. Note AWS Private CA is not supported in the China (Beijing) Region and the China (Ningxia) Region. ACM failure code Comment PCA_ACCESS_DENIED PCA_INVALID_DURATION PCA_INVALID_STATE The private CA has not granted ACM permissio ns. This triggers a AWS Private CA AccessDen iedException failure code. To remedy the problem, grant the necessary permissions to the ACM service principal using the AWS Private CA CreatePermission operation. The validity period of the requested certifica te exceeds the validity period of the issuing private CA. This triggers a AWS Private CA ValidationException failure code. To remedy the problem, install a new CA certificate with an appropriate validity period. The private CA being called is not in the correct state to perform the requested ACM operation. This triggers a AWS Private CA InvalidStateException failure code. Resolve the issue as follows: Private certificate exception handling Version 1.0 217 AWS Certificate Manager User Guide ACM failure code Comment • If the CA has the status CREATING, wait for creation to finish and then install the CA certificate. • If the CA has status PENDING_C ERTIFICATE , install the CA certificate. • If the CA has status DISABLED, update it to ACTIVE status. • If the CA has status DELETED, restore it. • If the CA has status EXPIRED, install a new certificate • If the CA has status FAILED, and you cannot resolve the issue, contact Support. The private CA has reached an issuance quota. This |
acm-ug-070 | acm-ug.pdf | 70 | Version 1.0 217 AWS Certificate Manager User Guide ACM failure code Comment • If the CA has the status CREATING, wait for creation to finish and then install the CA certificate. • If the CA has status PENDING_C ERTIFICATE , install the CA certificate. • If the CA has status DISABLED, update it to ACTIVE status. • If the CA has status DELETED, restore it. • If the CA has status EXPIRED, install a new certificate • If the CA has status FAILED, and you cannot resolve the issue, contact Support. The private CA has reached an issuance quota. This triggers a AWS Private CA LimitExce failure code. Try repeating ededException your request before proceeding with this help. If the error persists, contact Support to request a quota increase. A network or system error occurred. This triggers a AWS Private CA RequestFa failure code. Try repeating iledException your request before proceeding with this help. If the error persists, contact Support. PCA_LIMIT_EXCEEDED PCA_REQUEST_FAILED PCA_RESOURCE_NOT_FOUND The private CA has been permanently deleted. This triggers a AWS Private CA ResourceN failure code. Verify otFoundException that you used the correct ARN. If that fails, you won't be able to use this CA. To remedy the problem, create a new CA. Private certificate exception handling Version 1.0 218 AWS Certificate Manager ACM failure code SLR_NOT_FOUND User Guide Comment In order to renew a certificate signed by a private CA that resides in another account, ACM requires a Service Linked Role (SLR) on the account where the certificate resides. If you need to recreate a deleted SLR, see Creating the SLR for ACM. Private certificate exception handling Version 1.0 219 AWS Certificate Manager Quotas User Guide The following AWS Certificate Manager (ACM) service quotas apply to each AWS region per each AWS account. To see what quotas can be adjusted, see the ACM quotas table in the AWS General Reference Guide. To request quota increases, create a case at the Support Center. General quotas Item Default quota Number of ACM certificates 2500 Expired and revoked certificates continue to count toward this total. Certificates signed by a CA from AWS Private CA do not count toward this total. Number of ACM certificates per year (last 365 days) 5,000 You can request up to twice your quota of ACM certificates per year, region, and account. For example, if your quota is 2,500, you can request up to 5,000 ACM certificates per year in a given region and account. You can only have 2,500 certificates at any given time. To request 5,000 certificates in a year, you must delete 2,500 during the year to stay within the quota. If you need more than 2,500 certifica tes at any given time, you must contact the Support Center. Certificates signed by a CA from AWS Private CA do not count toward this total. General quotas Version 1.0 220 AWS Certificate Manager Item Number of imported certificates Number of imported certificates per year (last 365 days) Default quota 2,500 5,000 Number of domain names per ACM certifica te 10 User Guide The default quota is 10 domain names for each ACM certificate. Your quota may be greater. The first domain name that you submit is included as the subject common name (CN) of the certificate. All names are included in the Subject Alternative Name extension. You can request up to 100 domain names. To request an increase to your quota, create a request in the Service Quotas console for the ACM service. Before creating a case, however, make sure you understand how adding more domain names can create more administrative work for you if you use email validation. For more information, see Domain validation. The quota for the number of domain names per ACM certificate applies only to certifica tes that are provided by ACM. This quota does not apply to certificates that you import into ACM. The following sections apply only to ACM certificates. General quotas Version 1.0 221 AWS Certificate Manager Item Default quota User Guide Number of Private CAs 200 ACM is integrated with AWS Private Certifica te Authority (AWS Private CA). You can use the ACM console, AWS CLI, or ACM API to request private certificates from an existing private certificate authority (CA) hosted by AWS Private CA. These certificates are managed within the ACM environment and have the same restrictions as public certificates issued by ACM. For more information, see Request a private certificate in AWS Certificate Manager. You can also issue private certificates by using the standalone AWS Private CA service. For more information, see Issue a Private End- Entity Certificate. A private CA that has been deleted will count towards your quota until the end of its restoration period. For more information, see Deleting Your Private CA. Number of Private Certificates per CA (lifetime) 1,000,000 |
acm-ug-071 | acm-ug.pdf | 71 | existing private certificate authority (CA) hosted by AWS Private CA. These certificates are managed within the ACM environment and have the same restrictions as public certificates issued by ACM. For more information, see Request a private certificate in AWS Certificate Manager. You can also issue private certificates by using the standalone AWS Private CA service. For more information, see Issue a Private End- Entity Certificate. A private CA that has been deleted will count towards your quota until the end of its restoration period. For more information, see Deleting Your Private CA. Number of Private Certificates per CA (lifetime) 1,000,000 API rate quotas The following quotas apply to the ACM API for each region and account. ACM throttles API requests at different quotas depending on the API operation. Throttling means that ACM rejects an otherwise valid request because the request exceeds the operation's quota for the number of requests per second. When a request is throttled, ACM returns a ThrottlingException error. The following table lists each API operation and the quota at which ACM throttles requests for that operation. API rate quotas Version 1.0 222 AWS Certificate Manager Note User Guide In addition to the API actions listed in the table below, ACM can also call the external IssueCertificate action from AWS Private CA. For up-to-date rate quota information on IssueCertificate, see the endpoints and quotas for AWS Private CA. Requests-per-second quota for each ACM API operation API call Requests per second AddTagsToCertificate DeleteCertificate DescribeCertificate ExportCertificate GetAccountConfiguration GetCertificate ImportCertificate ListCertificates ListTagsForCertificate PutAccountConfiguration RemoveTagsFromCertificate RenewCertificate RequestCertificate ResendValidationEmail UpdateCertificateOptions 5 10 10 10 1 10 1 8 10 1 5 5 5 1 5 API rate quotas Version 1.0 223 AWS Certificate Manager User Guide For more information, see AWS Certificate Manager API Reference. API rate quotas Version 1.0 224 AWS Certificate Manager User Guide Document history The following table describes the documentation release history of AWS Certificate Manager beginning in 2018. Change Description Date ACM supports HTTP validatio n with CloudFront ACM now supports HTTP validation for domain April 24, 2025 ownership verification when issuing certificates for CloudFront distributions. Deprecation of mail exchanger (MX) email The ACM console no longer supports mail exchanger July 11, 2024 validation (MX). Adding best practice around account-level separation Use account-level separatio n in your policies wherever June 11, 2024 Upcoming deprecation of WHOIS email verification Condition key support added possible. If not possible, you can restrict permissions at the account level or through encryption context condition keys in your policies. Added a note about the deprecation of WHOIS email verification starting in June 2024. Added support for IAM Condition keys when requesting ACM certifica tes. For a list of supported conditions, see https:// docs.aws.amazon.com/acm/ latest/userguide/acm-condi February 5, 2024 August 24, 2023 Version 1.0 225 AWS Certificate Manager User Guide ECDSA support added New CloudWatch Events November 8, 2022 October 27, 2022 tions.html#acm-conditions-s upported. Added support for Elliptic Curve Digital Signature Algorithm (ECDSA) when requesting a public ACM certificate. For a list of supported key algorithms, see https://docs.aws.amazon.co m/acm/latest/userguide/ acm-certificate.html#algori thms. Added ACM Certificate Expired, ACM Certificate Available, and ACM Certifica te Renewal Action Required events. For a list of supported CloudWatch Events, see https://docs.aws.amazon.co m/acm/latest/userguide/ cloudwatch-events.html. Updating key algorithm types for import Certificates imported into ACM may now have keys with July 14, 2021 additional RSA and Elliptic Curve algorithms. For a list of currently supported key algorithms, see https:// docs.aws.amazon.com/acm/ latest/userguide/import-ce rtificate-prerequisites.html. Version 1.0 226 AWS Certificate Manager User Guide Promoting "Monitoring and Logging" as a separate Moved monitoring and logging documentation to March 23, 2021 chapter its own chapter. This change covers CloudWatch Metrics, CloudWatch Events/Ev entBridge, and CloudTrail. For more information, see https://docs.aws.amazon.co m/acm/latest/userguide/ monitoring-and-logging.html. Added CloudWatch Metrics and Events support Added DaysToExpiry metric and event and supportin March 3, 2021 Added cross-account support g APIs. For more informati on, see https://docs.aws. amazon.com/acm/latest/us erguide/cloudwatch-metrics .html and https://docs.aws. amazon.com/acm/latest/us erguide/cloudwatch-events. html. Added cross-account support for using private CAs from AWS Private CA. For more information, see https:// docs.aws.amazon.com/acm/ latest/userguide/ca-access .html. August 17, 2020 Version 1.0 227 AWS Certificate Manager Added region support Added renewal workflow testing Certificate transparency logging now default Launching AWS Private CA User Guide March 4, 2020 March 14, 2019 April 24, 2018 April 4, 2018 Added region support for the AWS China (Beijing and Ningxia) Regions. For a complete list of supported regions, see https://docs.aws. amazon.com/general/latest /gr/rande.html#acm-pca_re gion. Customers can now manually test the configuration of their ACM managed renewal workflow. For more informati on, see Testing ACM's Managed Renewal Configura tion. Added ability to publish ACM public certificates into certificate transparency logs by default. Launched ACM Private Certificate Manager (CM), and extension of AWS Certifica te Manager that allows users to establish a secure managed infrastructure for issuing and revoking private digital certificates. For more information, see AWS |
acm-ug-072 | acm-ug.pdf | 72 | April 24, 2018 April 4, 2018 Added region support for the AWS China (Beijing and Ningxia) Regions. For a complete list of supported regions, see https://docs.aws. amazon.com/general/latest /gr/rande.html#acm-pca_re gion. Customers can now manually test the configuration of their ACM managed renewal workflow. For more informati on, see Testing ACM's Managed Renewal Configura tion. Added ability to publish ACM public certificates into certificate transparency logs by default. Launched ACM Private Certificate Manager (CM), and extension of AWS Certifica te Manager that allows users to establish a secure managed infrastructure for issuing and revoking private digital certificates. For more information, see AWS Private Certificate Authority. Certificate transparency logging Added certificate transpare ncy logging to Best Practices. March 27, 2018 Version 1.0 228 AWS Certificate Manager User Guide The following table describes the documentation release history of AWS Certificate Manager prior to 2018. Change New content New content New content New content New content New content New content Description Release Date Added DNS validation to AWS Certificate Manager DNS validation. Added new Java code examples to Use AWS Certificate Manager with the SDK for Java. Added information about CAA records to (Optional) Configure a CAA record. Added information about .IO domains to Troubleshoot issues with AWS Certificate Manager. Added information about reimporting a certificate to Reimport a certificate. Added information about certificate pinning to Best practices and to Troubleshoot issues with AWS Certificate Manager. Added AWS CloudFormation to Services integrated with ACM. November 21, 2017 October 12, 2017 September 21, 2017 July 07, 2017 July 07, 2017 July 07, 2017 May 27, 2017 Version 1.0 229 AWS Certificate Manager User Guide Change Update New content Update Update Update Update New content Update Description Added more information to Quotas. Added documentation about Identity and Access Management for AWS Certificate Manager. Added a graphic to show where validation email is sent. See AWS Certificate Manager email validation. Added information about setting up email for your domain. See AWS Certificate Manager email validation. Added information about checking certificate renewal status in the console. See Check a certificate's renewal status. Updated the documenta tion for using Elastic Load Balancing. Added support for AWS Elastic Beanstalk and Amazon API Gateway. See Services integrated with ACM. Updated the documentation about Managed certificate renewal. Release Date May 27, 2017 April 28, 2017 April 21, 2017 April 6, 2017 March 28, 2017 March 21, 2017 March 21, 2017 February 20, 2017 Version 1.0 230 AWS Certificate Manager User Guide Change New content New content Description Release Date Added documentation about Imported certificates. October 13, 2016 Added AWS CloudTrail support for ACM actions. See Using CloudTrail with AWS Certificate Manager. March 25, 2016 New guide This release introduces AWS Certificate Manager. January 21, 2016 Version 1.0 231 |
acw-api-001 | acw-api.pdf | 1 | API Reference Amazon CloudWatch API Version 2010-08-01 Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon CloudWatch API Reference Amazon CloudWatch: API Reference Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon CloudWatch Table of Contents API Reference Welcome ........................................................................................................................................... 1 Actions .............................................................................................................................................. 2 DeleteAlarms ................................................................................................................................................. 4 Request Parameters ................................................................................................................................ 4 Errors .......................................................................................................................................................... 5 See Also ..................................................................................................................................................... 5 DeleteAnomalyDetector .............................................................................................................................. 6 Request Parameters ................................................................................................................................ 6 Errors .......................................................................................................................................................... 8 See Also ..................................................................................................................................................... 9 DeleteDashboards ...................................................................................................................................... 10 Request Parameters .............................................................................................................................. 10 Errors ....................................................................................................................................................... 10 See Also .................................................................................................................................................. 10 DeleteInsightRules ...................................................................................................................................... 12 Request Parameters .............................................................................................................................. 12 Response Elements ............................................................................................................................... 12 Errors ....................................................................................................................................................... 12 See Also .................................................................................................................................................. 13 DeleteMetricStream ................................................................................................................................... 14 Request Parameters .............................................................................................................................. 14 Errors ....................................................................................................................................................... 14 See Also .................................................................................................................................................. 14 DescribeAlarmHistory ................................................................................................................................ 16 Request Parameters .............................................................................................................................. 16 Response Elements ............................................................................................................................... 18 Errors ....................................................................................................................................................... 18 See Also .................................................................................................................................................. 18 DescribeAlarms ........................................................................................................................................... 20 Request Parameters .............................................................................................................................. 20 Response Elements ............................................................................................................................... 23 Errors ....................................................................................................................................................... 24 See Also .................................................................................................................................................. 24 DescribeAlarmsForMetric .......................................................................................................................... 25 API Version 2010-08-01 iii Amazon CloudWatch API Reference Request Parameters .............................................................................................................................. 25 Response Elements ............................................................................................................................... 27 Errors ....................................................................................................................................................... 27 See Also .................................................................................................................................................. 27 DescribeAnomalyDetectors ...................................................................................................................... 28 Request Parameters .............................................................................................................................. 28 Response Elements ............................................................................................................................... 29 Errors ....................................................................................................................................................... 30 Examples ................................................................................................................................................. 30 See Also .................................................................................................................................................. 33 DescribeInsightRules .................................................................................................................................. 34 Request Parameters .............................................................................................................................. 34 Response Elements ............................................................................................................................... 34 Errors ....................................................................................................................................................... 35 See Also .................................................................................................................................................. 35 DisableAlarmActions .................................................................................................................................. 36 Request Parameters .............................................................................................................................. 36 Errors ....................................................................................................................................................... 36 See Also .................................................................................................................................................. 36 DisableInsightRules .................................................................................................................................... 38 Request Parameters .............................................................................................................................. 38 Response Elements ............................................................................................................................... 38 Errors ....................................................................................................................................................... 38 See Also .................................................................................................................................................. 39 EnableAlarmActions ................................................................................................................................... 40 Request Parameters .............................................................................................................................. 40 Errors ....................................................................................................................................................... 40 See Also .................................................................................................................................................. 40 EnableInsightRules ..................................................................................................................................... 42 Request Parameters .............................................................................................................................. 42 Response Elements ............................................................................................................................... 42 Errors ....................................................................................................................................................... 42 See Also .................................................................................................................................................. 43 GetDashboard .............................................................................................................................................. 44 Request Parameters .............................................................................................................................. 44 Response Elements ............................................................................................................................... 44 API Version 2010-08-01 iv Amazon CloudWatch API Reference Errors ....................................................................................................................................................... 45 See Also .................................................................................................................................................. 45 GetInsightRuleReport ................................................................................................................................ 46 Request Parameters .............................................................................................................................. 46 Response Elements ............................................................................................................................... 48 Errors ....................................................................................................................................................... 49 See Also .................................................................................................................................................. 50 GetMetricData ............................................................................................................................................. 51 Request Parameters .............................................................................................................................. 52 Response Elements ............................................................................................................................... 54 Errors ....................................................................................................................................................... 55 Examples ................................................................................................................................................. 55 See Also .................................................................................................................................................. 69 GetMetricStatistics ..................................................................................................................................... 70 Request Parameters .............................................................................................................................. 71 Response Elements ............................................................................................................................... 74 Errors ....................................................................................................................................................... 75 See Also .................................................................................................................................................. 75 GetMetricStream ......................................................................................................................................... 77 Request Parameters .............................................................................................................................. 77 Response Elements ............................................................................................................................... 77 Errors ....................................................................................................................................................... 79 See Also .................................................................................................................................................. 80 GetMetricWidgetImage ............................................................................................................................. 81 Request Parameters .............................................................................................................................. 81 Response Elements ............................................................................................................................... 82 Errors ....................................................................................................................................................... 82 Examples ................................................................................................................................................. 83 See Also .................................................................................................................................................. 83 ListDashboards ............................................................................................................................................ 84 Request Parameters .............................................................................................................................. 84 Response Elements ............................................................................................................................... 84 Errors ....................................................................................................................................................... 85 See Also .................................................................................................................................................. 85 ListManagedInsightRules .......................................................................................................................... 86 Request Parameters .............................................................................................................................. 86 API Version 2010-08-01 v Amazon CloudWatch API Reference Response Elements ............................................................................................................................... 86 Errors ....................................................................................................................................................... 87 See Also .................................................................................................................................................. 87 ListMetrics .................................................................................................................................................... 89 Request Parameters .............................................................................................................................. 89 Response Elements ............................................................................................................................... 91 Errors ....................................................................................................................................................... 92 Examples ................................................................................................................................................. 92 See Also .................................................................................................................................................. 93 ListMetricStreams ....................................................................................................................................... 94 Request Parameters .............................................................................................................................. 94 Response Elements ............................................................................................................................... 94 Errors ....................................................................................................................................................... 95 See Also .................................................................................................................................................. 95 ListTagsForResource ................................................................................................................................... 97 Request Parameters .............................................................................................................................. 97 Response Elements ............................................................................................................................... 97 Errors ....................................................................................................................................................... 97 See Also .................................................................................................................................................. 98 PutAnomalyDetector ................................................................................................................................. 99 Request Parameters .............................................................................................................................. 99 Errors ..................................................................................................................................................... 102 See Also ................................................................................................................................................ 102 PutCompositeAlarm ................................................................................................................................. 104 Request Parameters ........................................................................................................................... 105 Errors ..................................................................................................................................................... 110 Examples ............................................................................................................................................... 111 See Also ................................................................................................................................................ 111 PutDashboard ........................................................................................................................................... 112 Request Parameters ........................................................................................................................... 112 Response Elements ............................................................................................................................ 113 Errors ..................................................................................................................................................... 113 Examples ............................................................................................................................................... 113 See Also ................................................................................................................................................ 120 PutInsightRule .......................................................................................................................................... 121 Request Parameters ........................................................................................................................... 121 API Version 2010-08-01 vi Amazon CloudWatch API Reference Errors ..................................................................................................................................................... 122 See Also ................................................................................................................................................ 123 PutManagedInsightRules ........................................................................................................................ 124 Request Parameters ........................................................................................................................... 124 Response Elements ............................................................................................................................ 124 Errors ..................................................................................................................................................... 124 See Also ................................................................................................................................................ 125 PutMetricAlarm ......................................................................................................................................... 126 Request Parameters ........................................................................................................................... 127 Errors ..................................................................................................................................................... 138 Examples ............................................................................................................................................... 138 See Also ................................................................................................................................................ 143 PutMetricData ........................................................................................................................................... 144 Request Parameters ........................................................................................................................... 145 Errors ..................................................................................................................................................... 147 Examples ............................................................................................................................................... 147 See Also ................................................................................................................................................ 152 PutMetricStream ...................................................................................................................................... 153 Request Parameters ........................................................................................................................... 153 Response Elements ............................................................................................................................ 156 Errors ..................................................................................................................................................... 156 Examples ............................................................................................................................................... 157 See Also ................................................................................................................................................ 159 SetAlarmState ........................................................................................................................................... 161 Request Parameters ........................................................................................................................... 161 Errors ..................................................................................................................................................... 162 Examples ............................................................................................................................................... 162 See Also ................................................................................................................................................ 163 StartMetricStreams .................................................................................................................................. 164 Request Parameters ........................................................................................................................... 164 Errors ..................................................................................................................................................... 164 See Also ................................................................................................................................................ 165 StopMetricStreams .................................................................................................................................. 166 Request Parameters ........................................................................................................................... 166 Errors ..................................................................................................................................................... 166 See Also ................................................................................................................................................ 167 API Version 2010-08-01 vii Amazon CloudWatch API Reference TagResource .............................................................................................................................................. 168 Request Parameters ........................................................................................................................... 168 Errors ..................................................................................................................................................... 169 See Also ................................................................................................................................................ 169 UntagResource .......................................................................................................................................... |
acw-api-002 | acw-api.pdf | 2 | Errors ..................................................................................................................................................... 147 Examples ............................................................................................................................................... 147 See Also ................................................................................................................................................ 152 PutMetricStream ...................................................................................................................................... 153 Request Parameters ........................................................................................................................... 153 Response Elements ............................................................................................................................ 156 Errors ..................................................................................................................................................... 156 Examples ............................................................................................................................................... 157 See Also ................................................................................................................................................ 159 SetAlarmState ........................................................................................................................................... 161 Request Parameters ........................................................................................................................... 161 Errors ..................................................................................................................................................... 162 Examples ............................................................................................................................................... 162 See Also ................................................................................................................................................ 163 StartMetricStreams .................................................................................................................................. 164 Request Parameters ........................................................................................................................... 164 Errors ..................................................................................................................................................... 164 See Also ................................................................................................................................................ 165 StopMetricStreams .................................................................................................................................. 166 Request Parameters ........................................................................................................................... 166 Errors ..................................................................................................................................................... 166 See Also ................................................................................................................................................ 167 API Version 2010-08-01 vii Amazon CloudWatch API Reference TagResource .............................................................................................................................................. 168 Request Parameters ........................................................................................................................... 168 Errors ..................................................................................................................................................... 169 See Also ................................................................................................................................................ 169 UntagResource .......................................................................................................................................... 171 Request Parameters ........................................................................................................................... 171 Errors ..................................................................................................................................................... 171 See Also ................................................................................................................................................ 172 Data Types ................................................................................................................................... 173 AlarmHistoryItem ..................................................................................................................................... 175 Contents ............................................................................................................................................... 175 See Also ................................................................................................................................................ 176 AnomalyDetector ..................................................................................................................................... 177 Contents ............................................................................................................................................... 177 See Also ................................................................................................................................................ 179 AnomalyDetectorConfiguration ............................................................................................................ 180 Contents ............................................................................................................................................... 180 See Also ................................................................................................................................................ 180 CompositeAlarm ....................................................................................................................................... 182 Contents ............................................................................................................................................... 182 See Also ................................................................................................................................................ 186 DashboardEntry ........................................................................................................................................ 188 Contents ............................................................................................................................................... 188 See Also ................................................................................................................................................ 188 DashboardValidationMessage ................................................................................................................ 190 Contents ............................................................................................................................................... 190 See Also ................................................................................................................................................ 190 Datapoint ................................................................................................................................................... 191 Contents ............................................................................................................................................... 191 See Also ................................................................................................................................................ 192 Dimension .................................................................................................................................................. 193 Contents ............................................................................................................................................... 193 See Also ................................................................................................................................................ 193 DimensionFilter ........................................................................................................................................ 195 Contents ............................................................................................................................................... 195 See Also ................................................................................................................................................ 195 API Version 2010-08-01 viii Amazon CloudWatch API Reference Entity .......................................................................................................................................................... 196 Contents ............................................................................................................................................... 196 See Also ................................................................................................................................................ 197 EntityMetricData ...................................................................................................................................... 198 Contents ............................................................................................................................................... 198 See Also ................................................................................................................................................ 198 InsightRule ................................................................................................................................................. 199 Contents ............................................................................................................................................... 199 See Also ................................................................................................................................................ 200 InsightRuleContributor ............................................................................................................................ 201 Contents ............................................................................................................................................... 201 See Also ................................................................................................................................................ 201 InsightRuleContributorDatapoint ......................................................................................................... 203 Contents ............................................................................................................................................... 203 See Also ................................................................................................................................................ 203 InsightRuleMetricDatapoint ................................................................................................................... 204 Contents ............................................................................................................................................... 204 See Also ................................................................................................................................................ 206 LabelOptions ............................................................................................................................................. 207 Contents ............................................................................................................................................... 207 See Also ................................................................................................................................................ 207 ManagedRule ............................................................................................................................................ 208 Contents ............................................................................................................................................... 208 See Also ................................................................................................................................................ 209 ManagedRuleDescription ........................................................................................................................ 210 Contents ............................................................................................................................................... 210 See Also ................................................................................................................................................ 210 ManagedRuleState ................................................................................................................................... 212 Contents ............................................................................................................................................... 212 See Also ................................................................................................................................................ 212 MessageData ............................................................................................................................................. 213 Contents ............................................................................................................................................... 213 See Also ................................................................................................................................................ 213 Metric .......................................................................................................................................................... 214 Contents ............................................................................................................................................... 214 See Also ................................................................................................................................................ 214 API Version 2010-08-01 ix Amazon CloudWatch API Reference MetricAlarm ............................................................................................................................................... 216 Contents ............................................................................................................................................... 216 See Also ................................................................................................................................................ 222 MetricCharacteristics ............................................................................................................................... 224 Contents ............................................................................................................................................... 224 See Also ................................................................................................................................................ 224 MetricDataQuery ...................................................................................................................................... 225 Contents ............................................................................................................................................... 225 See Also ................................................................................................................................................ 228 MetricDataResult ...................................................................................................................................... 229 Contents ............................................................................................................................................... 229 See Also ................................................................................................................................................ 230 MetricDatum ............................................................................................................................................. 231 Contents ............................................................................................................................................... 231 See Also ................................................................................................................................................ 233 MetricMathAnomalyDetector ................................................................................................................. 234 Contents ............................................................................................................................................... 234 See Also ................................................................................................................................................ 234 MetricStat .................................................................................................................................................. 235 Contents ............................................................................................................................................... 235 See Also ................................................................................................................................................ 236 MetricStreamEntry ................................................................................................................................... 237 Contents ............................................................................................................................................... 237 See Also ................................................................................................................................................ 238 MetricStreamFilter ................................................................................................................................... 239 Contents ............................................................................................................................................... 239 See Also ................................................................................................................................................ 240 MetricStreamStatisticsConfiguration ................................................................................................... 241 Contents ............................................................................................................................................... 241 See Also ................................................................................................................................................ 241 MetricStreamStatisticsMetric ................................................................................................................. 243 Contents ............................................................................................................................................... 243 See Also ................................................................................................................................................ 243 PartialFailure ............................................................................................................................................. 244 Contents ............................................................................................................................................... 244 See Also ................................................................................................................................................ 244 API Version 2010-08-01 x Amazon CloudWatch API Reference Range .......................................................................................................................................................... 246 Contents ............................................................................................................................................... 246 See Also ................................................................................................................................................ 246 SingleMetricAnomalyDetector ............................................................................................................... 247 Contents ............................................................................................................................................... 247 See Also ................................................................................................................................................ 248 StatisticSet ................................................................................................................................................. 249 Contents ............................................................................................................................................... 249 See Also ................................................................................................................................................ 249 Tag ............................................................................................................................................................... 251 Contents ............................................................................................................................................... 251 See Also ................................................................................................................................................ 251 Dashboard Body Structure and Syntax ...................................................................................... 252 Overall Structure ...................................................................................................................................... 252 Widgets Array Structure ......................................................................................................................... 258 Variables Array Structure ....................................................................................................................... 259 Variable examples .............................................................................................................................. 263 Properties of a Text Widget Object ................................................................................................ 265 Properties of a Log Widget Object ...................................................................................................... 266 Properties of a Metric Widget Object ................................................................................................. 268 Metric Widget: Format for Each Metric in the Array ........................................................................ 275 Dashboard Widget Object: Rendering Properties Object Format ............................................. 278 Dashboard Widget Object: Annotation Properties ...................................................................... 280 Dashboard Widget Object: yAxis Properties Format ................................................................... 286 Dashboard Widget Object: Table Properties ................................................................................ 288 Properties of a Metrics Explorer Widget Object .............................................................................. 289 Valid resourceType Values for a Metric Explorer Widget Object ............................................... 294 Properties of an Alarm Status Widget Object .................................................................................. 296 GetMetricWidgetImage: Metric Widget Structure and Syntax .................................................. 300 Overall Structure ...................................................................................................................................... 300 Format for Each Metric in the Array of Metrics ................................................................................. 304 Options Object Format ..................................................................................................................... 306 Annotation Properties Format .............................................................................................................. 309 yAxis Properties Format ......................................................................................................................... 315 Making API Requests ................................................................................................................... 317 Amazon CloudWatch Endpoints ........................................................................................................... 317 API Version 2010-08-01 xi Amazon CloudWatch API Reference Query Parameters .................................................................................................................................... 317 Request Identifiers ................................................................................................................................... 317 Query API Authentication ...................................................................................................................... 318 Available Libraries .................................................................................................................................... 318 Making API Requests Using the POST Method ................................................................................. 318 Common Parameters ................................................................................................................... 321 Common Errors ............................................................................................................................ 324 API Version 2010-08-01 xii Amazon CloudWatch Welcome API Reference Amazon CloudWatch enables you to publish, monitor, and manage various metrics, as well as configure alarm actions based on data from metrics. This guide provides detailed information about CloudWatch actions, data types, parameters, and errors. For more information about CloudWatch features, see Amazon CloudWatch and the Amazon CloudWatch User Guide. For information about the metrics that other AWS products send to CloudWatch, see the Amazon CloudWatch Metrics and Dimensions Reference in |
acw-api-003 | acw-api.pdf | 3 | Libraries .................................................................................................................................... 318 Making API Requests Using the POST Method ................................................................................. 318 Common Parameters ................................................................................................................... 321 Common Errors ............................................................................................................................ 324 API Version 2010-08-01 xii Amazon CloudWatch Welcome API Reference Amazon CloudWatch enables you to publish, monitor, and manage various metrics, as well as configure alarm actions based on data from metrics. This guide provides detailed information about CloudWatch actions, data types, parameters, and errors. For more information about CloudWatch features, see Amazon CloudWatch and the Amazon CloudWatch User Guide. For information about the metrics that other AWS products send to CloudWatch, see the Amazon CloudWatch Metrics and Dimensions Reference in the Amazon CloudWatch User Guide. Use the following links to get started using the CloudWatch Query API: • Actions: An alphabetical list of all CloudWatch actions. • Data Types: An alphabetical list of all CloudWatch data types. • Common Parameters: Parameters that all Query actions can use. • Common Errors: Client and server errors that all actions can return. • Regions and Endpoints: Supported regions and endpoints for all AWS products. Alternatively, you can use one of the AWS SDKs to access CloudWatch using an API tailored to your programming language or platform. Developers in the AWS developer community also provide their own libraries, which you can find at the following AWS developer centers: • Java Developer Center • JavaScript Developer Center • AWS Mobile Services • PHP Developer Center • Python Developer Center • Ruby Developer Center • Windows and .NET Developer Center API Version 2010-08-01 1 Amazon CloudWatch Actions The following actions are supported: • DeleteAlarms • DeleteAnomalyDetector • DeleteDashboards • DeleteInsightRules • DeleteMetricStream • DescribeAlarmHistory • DescribeAlarms • DescribeAlarmsForMetric • DescribeAnomalyDetectors • DescribeInsightRules • DisableAlarmActions • DisableInsightRules • EnableAlarmActions • EnableInsightRules • GetDashboard • GetInsightRuleReport • GetMetricData • GetMetricStatistics • GetMetricStream • GetMetricWidgetImage • ListDashboards • ListManagedInsightRules • ListMetrics • ListMetricStreams • ListTagsForResource • PutAnomalyDetector • PutCompositeAlarm API Reference API Version 2010-08-01 2 Amazon CloudWatch • PutDashboard • PutInsightRule • PutManagedInsightRules • PutMetricAlarm • PutMetricData • PutMetricStream • SetAlarmState • StartMetricStreams • StopMetricStreams • TagResource • UntagResource API Reference API Version 2010-08-01 3 Amazon CloudWatch DeleteAlarms API Reference Deletes the specified alarms. You can delete up to 100 alarms in one operation. However, this total can include no more than one composite alarm. For example, you could delete 99 metric alarms and one composite alarms with one operation, but you can't delete two composite alarms with one operation. If you specify any incorrect alarm names, the alarms you specify with correct names are still deleted. Other syntax errors might result in no alarms being deleted. To confirm that alarms were deleted successfully, you can use the DescribeAlarms operation after using DeleteAlarms. Note It is possible to create a loop or cycle of composite alarms, where composite alarm A depends on composite alarm B, and composite alarm B also depends on composite alarm A. In this scenario, you can't delete any composite alarm that is part of the cycle because there is always still a composite alarm that depends on that alarm that you want to delete. To get out of such a situation, you must break the cycle by changing the rule of one of the composite alarms in the cycle to remove a dependency that creates the cycle. The simplest change to make to break a cycle is to change the AlarmRule of one of the alarms to false. Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the evaluation path. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AlarmNames.member.N The alarms to be deleted. Do not enclose the alarm names in quote marks. Type: Array of strings Array Members: Maximum number of 100 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes DeleteAlarms API Version 2010-08-01 4 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 5 Amazon CloudWatch API Reference DeleteAnomalyDetector Deletes the specified anomaly detection model from your account. For more information about how to delete an anomaly detection model, see Deleting an anomaly detection model in the CloudWatch User Guide. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N |
acw-api-004 | acw-api.pdf | 4 | for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 5 Amazon CloudWatch API Reference DeleteAnomalyDetector Deletes the specified anomaly detection model from your account. For more information about how to delete an anomaly detection model, see Deleting an anomaly detection model in the CloudWatch User Guide. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N This parameter has been deprecated. The metric dimensions associated with the anomaly detection model to delete. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MetricMathAnomalyDetector The metric math anomaly detector to be deleted. When using MetricMathAnomalyDetector, you cannot include following parameters in the same operation: • Dimensions, • MetricName • Namespace • Stat • the SingleMetricAnomalyDetector parameters of DeleteAnomalyDetectorInput Instead, specify the metric math anomaly detector attributes as part of the MetricMathAnomalyDetector property. Type: MetricMathAnomalyDetector object Required: No DeleteAnomalyDetector API Version 2010-08-01 6 Amazon CloudWatch MetricName This parameter has been deprecated. API Reference The metric name associated with the anomaly detection model to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace This parameter has been deprecated. The namespace associated with the anomaly detection model to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No SingleMetricAnomalyDetector A single metric anomaly detector to be deleted. When using SingleMetricAnomalyDetector, you cannot include the following parameters in the same operation: • Dimensions, • MetricName • Namespace • Stat • the MetricMathAnomalyDetector parameters of DeleteAnomalyDetectorInput Instead, specify the single metric anomaly detector attributes as part of the SingleMetricAnomalyDetector property. Type: SingleMetricAnomalyDetector object Request Parameters API Version 2010-08-01 7 Amazon CloudWatch Required: No Stat API Reference This parameter has been deprecated. The statistic associated with the anomaly detection model to delete. Type: String Length Constraints: Maximum length of 50. Pattern: (SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm) (\d{1,2}(\.\d{0,10})?|100)|[ou]\d+(\.\d*)?)(_E|_L|_H)?|(TM|TC|TS| WM)\(((((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?:((\d{1,2})(\. \d{0,10})?|100(\.0{0,10})?)%|((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%: (((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?)\)|(TM|TC|TS|WM|PR)\(((\d +(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)):((\d+(\.\d{0,10})?|(\d +(\.\d{0,10})?[Ee][+-]?\d+)))?|((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee] [+-]?\d+)))?:(\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))\) Required: No Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 Errors API Version 2010-08-01 8 API Reference Amazon CloudWatch MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 9 Amazon CloudWatch DeleteDashboards API Reference Deletes all dashboards that you specify. You can specify up to 100 dashboards to delete. If there is an error during this call, no dashboards are deleted. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. DashboardNames.member.N The dashboards to be deleted. This parameter is required. Type: Array of strings Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The specified dashboard does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: DeleteDashboards API Version 2010-08-01 10 API Reference Amazon CloudWatch • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 11 Amazon CloudWatch DeleteInsightRules API Reference Permanently deletes the specified Contributor Insights rules. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. RuleNames.member.N An |
acw-api-005 | acw-api.pdf | 5 | v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 11 Amazon CloudWatch DeleteInsightRules API Reference Permanently deletes the specified Contributor Insights rules. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. RuleNames.member.N An array of the rule names to delete. If you need to find out the names of your rules, use DescribeInsightRules. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes Response Elements The following element is returned by the service. Failures.member.N An array listing the rules that could not be deleted. You cannot delete built-in rules. Type: Array of PartialFailure objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. DeleteInsightRules API Version 2010-08-01 12 Amazon CloudWatch HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 13 Amazon CloudWatch API Reference DeleteMetricStream Permanently deletes the metric stream that you specify. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Name The name of the metric stream to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: DeleteMetricStream API Version 2010-08-01 14 API Reference Amazon CloudWatch • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 15 Amazon CloudWatch API Reference DescribeAlarmHistory Retrieves the history for the specified alarm. You can filter the results by date range or item type. If an alarm name is not specified, the histories for either all metric alarms or all composite alarms are returned. CloudWatch retains the history of an alarm even if you delete the alarm. To use this operation and return information about a composite alarm, you must be signed on with the cloudwatch:DescribeAlarmHistory permission that is scoped to *. You can't return information about composite alarms if your cloudwatch:DescribeAlarmHistory permission has a narrower scope. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AlarmName The name of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No AlarmTypes.member.N Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned. Type: Array of strings Valid Values: CompositeAlarm | MetricAlarm Required: No EndDate The ending date to retrieve alarm history. Type: Timestamp DescribeAlarmHistory API Version 2010-08-01 16 Amazon CloudWatch Required: No HistoryItemType The type of alarm histories to retrieve. Type: String API Reference Valid Values: ConfigurationUpdate | StateUpdate | Action Required: No MaxRecords The maximum number of alarm history records to retrieve. Type: Integer Valid Range: Minimum value of 1. Maximum value of 100. Required: No NextToken The token returned by a previous call to indicate that there is more data available. Type: String Required: No ScanBy Specified whether to return the newest or oldest alarm history first. Specify TimestampDescending to have the newest event history returned first, and specify TimestampAscending to have the oldest history returned first. Type: String Valid Values: TimestampDescending | TimestampAscending Required: No StartDate The |
acw-api-006 | acw-api.pdf | 6 | Type: String API Reference Valid Values: ConfigurationUpdate | StateUpdate | Action Required: No MaxRecords The maximum number of alarm history records to retrieve. Type: Integer Valid Range: Minimum value of 1. Maximum value of 100. Required: No NextToken The token returned by a previous call to indicate that there is more data available. Type: String Required: No ScanBy Specified whether to return the newest or oldest alarm history first. Specify TimestampDescending to have the newest event history returned first, and specify TimestampAscending to have the oldest history returned first. Type: String Valid Values: TimestampDescending | TimestampAscending Required: No StartDate The starting date to retrieve alarm history. Type: Timestamp Request Parameters API Version 2010-08-01 17 API Reference Amazon CloudWatch Required: No Response Elements The following elements are returned by the service. AlarmHistoryItems.member.N The alarm histories, in JSON format. Type: Array of AlarmHistoryItem objects NextToken The token that marks the start of the next batch of returned results. Type: String Errors For information about the errors that are common to all actions, see Common Errors. InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 Response Elements API Version 2010-08-01 18 Amazon CloudWatch • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 19 Amazon CloudWatch DescribeAlarms API Reference Retrieves the specified alarms. You can filter the results by specifying a prefix for the alarm name, the alarm state, or a prefix for any action. To use this operation and return information about composite alarms, you must be signed on with the cloudwatch:DescribeAlarms permission that is scoped to *. You can't return information about composite alarms if your cloudwatch:DescribeAlarms permission has a narrower scope. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ActionPrefix Use this parameter to filter the results of the operation to only those alarms that use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmNamePrefix An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names that start with this prefix. If this parameter is specified, you cannot specify AlarmNames. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No AlarmNames.member.N The names of the alarms to retrieve information about. Type: Array of strings DescribeAlarms API Version 2010-08-01 20 Amazon CloudWatch API Reference Array Members: Maximum number of 100 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: No AlarmTypes.member.N Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned, even if composite alarms exist in the account. For example, if you omit this parameter or specify MetricAlarms, the operation returns only a list of metric alarms. It does not return any composite alarms, even if composite alarms exist in the account. If you specify CompositeAlarms, the operation returns only a list of composite alarms, and does not return any metric alarms. Type: Array of strings Valid Values: CompositeAlarm | MetricAlarm Required: No ChildrenOfAlarmName If you use this parameter and specify the name of a composite alarm, the operation returns information about the "children" alarms of the alarm you specify. These are the metric alarms and composite alarms referenced in the AlarmRule field of the composite alarm that you specify in ChildrenOfAlarmName. Information about the composite alarm that you name in ChildrenOfAlarmName is not returned. If you specify ChildrenOfAlarmName, you cannot specify any other parameters in the request except for MaxRecords and NextToken. If you do so, you receive a validation error. Note Only the Alarm Name, ARN, StateValue (OK/ALARM/INSUFFICIENT_DATA), and StateUpdatedTimestamp information are returned by this operation when you use this parameter. To get complete information about these alarms, perform another Request Parameters API Version 2010-08-01 21 Amazon CloudWatch API Reference DescribeAlarms operation and specify the parent alarm names in the AlarmNames parameter. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No MaxRecords The maximum number of alarm descriptions to retrieve. Type: Integer Valid Range: Minimum value of 1. Maximum value of 100. Required: No NextToken The token returned by a previous call to indicate that there is more data available. |
acw-api-007 | acw-api.pdf | 7 | ARN, StateValue (OK/ALARM/INSUFFICIENT_DATA), and StateUpdatedTimestamp information are returned by this operation when you use this parameter. To get complete information about these alarms, perform another Request Parameters API Version 2010-08-01 21 Amazon CloudWatch API Reference DescribeAlarms operation and specify the parent alarm names in the AlarmNames parameter. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No MaxRecords The maximum number of alarm descriptions to retrieve. Type: Integer Valid Range: Minimum value of 1. Maximum value of 100. Required: No NextToken The token returned by a previous call to indicate that there is more data available. Type: String Required: No ParentsOfAlarmName If you use this parameter and specify the name of a metric or composite alarm, the operation returns information about the "parent" alarms of the alarm you specify. These are the composite alarms that have AlarmRule parameters that reference the alarm named in ParentsOfAlarmName. Information about the alarm that you specify in ParentsOfAlarmName is not returned. If you specify ParentsOfAlarmName, you cannot specify any other parameters in the request except for MaxRecords and NextToken. If you do so, you receive a validation error. Note Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about these alarms, perform another Request Parameters API Version 2010-08-01 22 Amazon CloudWatch API Reference DescribeAlarms operation and specify the parent alarm names in the AlarmNames parameter. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No StateValue Specify this parameter to receive information only about alarms that are currently in the state that you specify. Type: String Valid Values: OK | ALARM | INSUFFICIENT_DATA Required: No Response Elements The following elements are returned by the service. CompositeAlarms.member.N The information about any composite alarms returned by the operation. Type: Array of CompositeAlarm objects MetricAlarms.member.N The information about any metric alarms returned by the operation. Type: Array of MetricAlarm objects NextToken The token that marks the start of the next batch of returned results. Type: String Response Elements API Version 2010-08-01 23 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 24 Amazon CloudWatch API Reference DescribeAlarmsForMetric Retrieves the alarms for the specified metric. To filter the results, specify a statistic, period, or unit. This operation retrieves only standard alarms that are based on the specified metric. It does not return alarms based on math expressions that use the specified metric, or composite alarms that use the specified metric. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N The dimensions associated with the metric. If the metric has any associated dimensions, you must specify them in order for the call to succeed. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No ExtendedStatistic The percentile statistic for the metric. Specify a value between p0.0 and p100. Type: String Required: No MetricName The name of the metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Namespace The namespace of the metric. DescribeAlarmsForMetric API Version 2010-08-01 25 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: Yes Period The period, in seconds, over which the statistic is applied. Type: Integer Valid Range: Minimum value of 1. Required: No Statistic The statistic for the metric, other than percentiles. For percentile statistics, use ExtendedStatistics. Type: String Valid Values: SampleCount | Average | Sum | Minimum | Maximum Required: No Unit The unit for the metric. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No Request Parameters API Version 2010-08-01 26 API Reference Amazon CloudWatch Response Elements The following element is returned by the service. MetricAlarms.member.N The information for each alarm with the specified metric. Type: Array of MetricAlarm objects Errors For information about the errors that are common to all actions, see Common Errors. See |
acw-api-008 | acw-api.pdf | 8 | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No Request Parameters API Version 2010-08-01 26 API Reference Amazon CloudWatch Response Elements The following element is returned by the service. MetricAlarms.member.N The information for each alarm with the specified metric. Type: Array of MetricAlarm objects Errors For information about the errors that are common to all actions, see Common Errors. See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Response Elements API Version 2010-08-01 27 Amazon CloudWatch API Reference DescribeAnomalyDetectors Lists the anomaly detection models that you have created in your account. For single metric anomaly detectors, you can list all of the models in your account or filter the results to only the models that are related to a certain namespace, metric name, or metric dimension. For metric math anomaly detectors, you can list them by adding METRIC_MATH to the AnomalyDetectorTypes array. This will return all metric math anomaly detectors in your account. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AnomalyDetectorTypes.member.N The anomaly detector types to request when using DescribeAnomalyDetectorsInput. If empty, defaults to SINGLE_METRIC. Type: Array of strings Array Members: Maximum number of 2 items. Valid Values: SINGLE_METRIC | METRIC_MATH Required: No Dimensions.member.N Limits the results to only the anomaly detection models that are associated with the specified metric dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're all returned. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MaxResults The maximum number of results to return in one operation. The maximum value that you can specify is 100. To retrieve the remaining results, make another call with the returned NextToken value. DescribeAnomalyDetectors API Version 2010-08-01 28 Amazon CloudWatch Type: Integer Valid Range: Minimum value of 1. Required: No MetricName API Reference Limits the results to only the anomaly detection models that are associated with the specified metric name. If there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all returned. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace Limits the results to only the anomaly detection models that are associated with the specified namespace. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No NextToken Use the token returned by the previous operation to request the next page of results. Type: String Required: No Response Elements The following elements are returned by the service. AnomalyDetectors.member.N The list of anomaly detection models returned by the operation. Response Elements API Version 2010-08-01 29 Amazon CloudWatch API Reference Type: Array of AnomalyDetector objects NextToken A token that you can use in a subsequent operation to retrieve the next set of results. Type: String Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 Examples Example The following example lists all the anomaly detectors for metrics with the name CPUUtilization. Errors API Version 2010-08-01 30 API Reference Amazon CloudWatch Sample Request { "MetricName:": "CPUUtilization" } Sample Response { "AnomalyDetectors": [ { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "dimension1", "Value": "value1" }, { "Name": "dimension2", "Value": "value2" } ], "Stat": "Average", "Configuration": { "ExcludedTimeRanges": [ ] } }, { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "dimension1", "Value": "value1" } ], "Stat": "SampleCount", "Configuration": { "ExcludedTimeRanges": [ Examples API Version 2010-08-01 31 API Reference Amazon CloudWatch ] } }, { "Namespace": "APITest1", "MetricName": "Metric1", "Dimensions": [ { "Name": "dimension1", "Value": "value1" } ], "Stat": "SampleCount", "Configuration": { "ExcludedTimeRanges": [ ] } }, { "Namespace": "CustomNamespace", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "dimension1", "Value": "value1" }, { "Name": "dimension2", "Value": "value2" } ], "Stat": "Maximum", "Configuration": { "ExcludedTimeRanges": [ ] } } ] } Examples API Version 2010-08-01 32 Amazon CloudWatch See |
acw-api-009 | acw-api.pdf | 9 | { "ExcludedTimeRanges": [ ] } }, { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "dimension1", "Value": "value1" } ], "Stat": "SampleCount", "Configuration": { "ExcludedTimeRanges": [ Examples API Version 2010-08-01 31 API Reference Amazon CloudWatch ] } }, { "Namespace": "APITest1", "MetricName": "Metric1", "Dimensions": [ { "Name": "dimension1", "Value": "value1" } ], "Stat": "SampleCount", "Configuration": { "ExcludedTimeRanges": [ ] } }, { "Namespace": "CustomNamespace", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "dimension1", "Value": "value1" }, { "Name": "dimension2", "Value": "value2" } ], "Stat": "Maximum", "Configuration": { "ExcludedTimeRanges": [ ] } } ] } Examples API Version 2010-08-01 32 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 33 Amazon CloudWatch API Reference DescribeInsightRules Returns a list of all the Contributor Insights rules in your account. For more information about Contributor Insights, see Using Contributor Insights to Analyze High- Cardinality Data. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. MaxResults The maximum number of results to return in one operation. If you omit this parameter, the default of 500 is used. Type: Integer Valid Range: Minimum value of 1. Maximum value of 500. Required: No NextToken Include this value, if it was returned by the previous operation, to get the next set of rules. Type: String Required: No Response Elements The following elements are returned by the service. InsightRules.member.N The rules returned by the operation. Type: Array of InsightRule objects NextToken If this parameter is present, it is a token that marks the start of the next batch of returned results. DescribeInsightRules API Version 2010-08-01 34 Amazon CloudWatch Type: String Errors API Reference For information about the errors that are common to all actions, see Common Errors. InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 35 Amazon CloudWatch API Reference DisableAlarmActions Disables the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions do not execute when the alarm state changes. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AlarmNames.member.N The names of the alarms. Type: Array of strings Array Members: Maximum number of 100 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 DisableAlarmActions API Version 2010-08-01 36 Amazon CloudWatch • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 37 Amazon CloudWatch DisableInsightRules API Reference Disables the specified Contributor Insights rules. When rules are disabled, they do not analyze log groups and do not incur costs. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. RuleNames.member.N An array of the rule names to disable. If you need to find out the names of your rules, use DescribeInsightRules. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes Response Elements The following element is returned by the service. Failures.member.N An array listing the rules that could not be disabled. You cannot disable built-in rules. Type: Array of PartialFailure objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 DisableInsightRules API Version 2010-08-01 38 Amazon CloudWatch MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also API Reference For more information about using this API in |
acw-api-010 | acw-api.pdf | 10 | length of 128. Pattern: [\x20-\x7E]+ Required: Yes Response Elements The following element is returned by the service. Failures.member.N An array listing the rules that could not be disabled. You cannot disable built-in rules. Type: Array of PartialFailure objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 DisableInsightRules API Version 2010-08-01 38 Amazon CloudWatch MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 39 Amazon CloudWatch API Reference EnableAlarmActions Enables the actions for the specified alarms. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AlarmNames.member.N The names of the alarms. Type: Array of strings Array Members: Maximum number of 100 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python EnableAlarmActions API Version 2010-08-01 40 Amazon CloudWatch • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 41 Amazon CloudWatch EnableInsightRules API Reference Enables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. RuleNames.member.N An array of the rule names to enable. If you need to find out the names of your rules, use DescribeInsightRules. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes Response Elements The following element is returned by the service. Failures.member.N An array listing the rules that could not be enabled. You cannot disable or enable built-in rules. Type: Array of PartialFailure objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 EnableInsightRules API Version 2010-08-01 42 API Reference Amazon CloudWatch LimitExceeded The operation exceeded one or more limits. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 43 Amazon CloudWatch GetDashboard API Reference Displays the details of the dashboard that you specify. To copy an existing dashboard, use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard to create the copy. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. DashboardName The name of the dashboard to be described. Type: String Required: Yes Response Elements The following elements are returned by the service. DashboardArn The Amazon Resource Name (ARN) of the dashboard. Type: String DashboardBody The detailed information about the dashboard, including what widgets are included and their location on the dashboard. For more information about the DashboardBody syntax, see Dashboard Body Structure and Syntax. Type: String DashboardName The name of the dashboard. Type: String GetDashboard API Version 2010-08-01 44 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The specified dashboard does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the |
acw-api-011 | acw-api.pdf | 11 | about the DashboardBody syntax, see Dashboard Body Structure and Syntax. Type: String DashboardName The name of the dashboard. Type: String GetDashboard API Version 2010-08-01 44 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The specified dashboard does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 45 Amazon CloudWatch API Reference GetInsightRuleReport This operation returns the time series data collected by a Contributor Insights rule. The data includes the identity and number of contributors to the log group. You can also optionally return one or more statistics about each data point in the time series. These statistics can include the following: • UniqueContributors -- the number of unique contributors for each data point. • MaxContributorValue -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph. If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's Value, during that period. • SampleCount -- the number of data points matched by the rule. • Sum -- the sum of the values from all contributors during the time period represented by that data point. • Minimum -- the minimum value from a single observation during the time period represented by that data point. • Maximum -- the maximum value from a single observation during the time period represented by that data point. • Average -- the average value from all contributors during the time period represented by that data point. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. EndTime The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. Type: Timestamp Required: Yes GetInsightRuleReport API Version 2010-08-01 46 Amazon CloudWatch MaxContributorCount API Reference The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used. Type: Integer Required: No Metrics.member.N Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more of the following metrics: • UniqueContributors -- the number of unique contributors for each data point. • MaxContributorValue -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph. If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's Value, during that period. • SampleCount -- the number of data points matched by the rule. • Sum -- the sum of the values from all contributors during the time period represented by that data point. • Minimum -- the minimum value from a single observation during the time period represented by that data point. • Maximum -- the maximum value from a single observation during the time period represented by that data point. • Average -- the average value from all contributors during the time period represented by that data point. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: No Request Parameters API Version 2010-08-01 47 Amazon CloudWatch OrderBy API Reference Determines what statistic to use to rank the contributors. Valid values are Sum and Maximum. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: No Period The period, in seconds, to use for the statistics in the InsightRuleMetricDatapoint results. Type: Integer Valid Range: Minimum value of 1. Required: Yes RuleName The name of the rule that you want to see data from. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: |
acw-api-012 | acw-api.pdf | 12 | of 32. Pattern: [\x20-\x7E]+ Required: No Request Parameters API Version 2010-08-01 47 Amazon CloudWatch OrderBy API Reference Determines what statistic to use to rank the contributors. Valid values are Sum and Maximum. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: No Period The period, in seconds, to use for the statistics in the InsightRuleMetricDatapoint results. Type: Integer Valid Range: Minimum value of 1. Required: Yes RuleName The name of the rule that you want to see data from. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes StartTime The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. Type: Timestamp Required: Yes Response Elements The following elements are returned by the service. Response Elements API Version 2010-08-01 48 Amazon CloudWatch AggregateValue API Reference The sum of the values from all individual contributors that match the rule. Type: Double AggregationStatistic Specifies whether this rule aggregates contributor data by COUNT or SUM. Type: String ApproximateUniqueCount An approximate count of the unique contributors found by this rule in this time period. Type: Long Contributors.member.N An array of the unique contributors found by this rule in this time period. If the rule contains multiple keys, each combination of values for the keys counts as a unique contributor. Type: Array of InsightRuleContributor objects KeyLabels.member.N An array of the strings used as the keys for this rule. The keys are the dimensions used to classify contributors. If the rule contains more than one key, then each unique combination of values for the keys is counted as a unique contributor. Type: Array of strings MetricDatapoints.member.N A time series of metric data points that matches the time period in the rule request. Type: Array of InsightRuleMetricDatapoint objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. Errors API Version 2010-08-01 49 API Reference Amazon CloudWatch HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 50 Amazon CloudWatch GetMetricData API Reference You can use the GetMetricData API to retrieve CloudWatch metric values. The operation can also include a CloudWatch Metrics Insights query, and one or more metric math functions. A GetMetricData operation that does not include a query can retrieve as many as 500 different metrics in a single request, with a total of as many as 100,800 data points. You can also optionally perform metric math expressions on the values of the returned statistics, to create new time series that represent new insights into your data. For example, using Lambda metrics, you could divide the Errors metric by the Invocations metric to get an error rate time series. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide. If you include a Metrics Insights query, each GetMetricData operation can include only one query. But the same GetMetricData operation can also retrieve other metrics. Metrics Insights queries can query only the most recent three hours of metric data. For more information about Metrics Insights, see Query your metrics with CloudWatch Metrics Insights. Calls to the GetMetricData API have a different pricing structure than calls to GetMetricStatistics. For more information about pricing, see Amazon CloudWatch Pricing. Amazon CloudWatch retains metric data as follows: • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution metrics and are available only for custom metrics that have been defined with a StorageResolution of 1. • Data points with a period of 60 seconds (1-minute) are available for 15 days. • Data points with a period of 300 seconds (5-minute) are available for 63 days. • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months). Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, |
acw-api-013 | acw-api.pdf | 13 | defined with a StorageResolution of 1. • Data points with a period of 60 seconds (1-minute) are available for 15 days. • Data points with a period of 300 seconds (5-minute) are available for 63 days. • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months). Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, but is aggregated and retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour. If you omit Unit in your request, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If GetMetricData API Version 2010-08-01 51 Amazon CloudWatch API Reference you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions. Using Metrics Insights queries with metric math You can't mix a Metric Insights query and metric math syntax in the same expression, but you can reference results from a Metrics Insights query within other Metric math expressions. A Metrics Insights query without a GROUP BY clause returns a single time-series (TS), and can be used as input for a metric math expression that expects a single time series. A Metrics Insights query with a GROUP BY clause returns an array of time-series (TS[]), and can be used as input for a metric math expression that expects an array of time series. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. EndTime The time stamp indicating the latest data to be returned. The value specified is exclusive; results include data points up to the specified time stamp. For better performance, specify StartTime and EndTime values that align with the value of the metric's Period and sync up with the beginning and end of an hour. For example, if the Period of a metric is 5 minutes, specifying 12:05 or 12:30 as EndTime can get a faster response from CloudWatch than setting 12:07 or 12:29 as the EndTime. Type: Timestamp Required: Yes LabelOptions This structure includes the Timezone parameter, which you can use to specify your time zone so that the labels of returned data display the correct time for your time zone. Type: LabelOptions object Required: No Request Parameters API Version 2010-08-01 52 Amazon CloudWatch MaxDatapoints API Reference The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used. Type: Integer Required: No MetricDataQueries.member.N The metric queries to be returned. A single GetMetricData call can include as many as 500 MetricDataQuery structures. Each of these structures can specify either a metric to retrieve, a Metrics Insights query, or a math expression to perform on retrieved data. Type: Array of MetricDataQuery objects Required: Yes NextToken Include this value, if it was returned by the previous GetMetricData operation, to get the next set of data points. Type: String Required: No ScanBy The order in which data points should be returned. TimestampDescending returns the newest data first and paginates when the MaxDatapoints limit is reached. TimestampAscending returns the oldest data first and paginates when the MaxDatapoints limit is reached. If you omit this parameter, the default of TimestampDescending is used. Type: String Valid Values: TimestampDescending | TimestampAscending Required: No StartTime The time stamp indicating the earliest data to be returned. The value specified is inclusive; results include data points with the specified time stamp. Request Parameters API Version 2010-08-01 53 Amazon CloudWatch API Reference CloudWatch rounds the specified time stamp as follows: • Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00. • Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00. • Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00. If you set Period to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request |
acw-api-014 | acw-api.pdf | 14 | ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00. • Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00. If you set Period to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. For better performance, specify StartTime and EndTime values that align with the value of the metric's Period and sync up with the beginning and end of an hour. For example, if the Period of a metric is 5 minutes, specifying 12:05 or 12:30 as StartTime can get a faster response from CloudWatch than setting 12:07 or 12:29 as the StartTime. Type: Timestamp Required: Yes Response Elements The following elements are returned by the service. Messages.member.N Contains a message about this GetMetricData operation, if the operation results in such a message. An example of a message that might be returned is Maximum number of allowed metrics exceeded. If there is a message, as much of the operation as possible is still executed. A message appears here only if it is related to the global GetMetricData operation. Any message about a specific metric returned by the operation appears in the MetricDataResult object returned for that metric. Response Elements API Version 2010-08-01 54 Amazon CloudWatch API Reference Type: Array of MessageData objects MetricDataResults.member.N The metrics that are returned, including the metric name, namespace, and dimensions. Type: Array of MetricDataResult objects NextToken A token that marks the next batch of returned results. Type: String Errors For information about the errors that are common to all actions, see Common Errors. InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 Examples Example The following example requests a Metrics Insights query for aggregated CPUUtilization, and a metric. Sample Request { "StartTime": 1637061900, "EndTime": 1637074500, "MetricDataQueries": [ { "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId)", "Id": "q1", "Period": 300, Errors API Version 2010-08-01 55 Amazon CloudWatch API Reference "Label": "Cluster CpuUtilization" }, { "Id": "m1", "Label": "Unhealthy Behind Load Balancer", "MetricStat": { "Metric": { "Namespace": "AWS/ApplicationELB", "MetricName": "UnHealthyHostCount", "Dimensions": [ { "Name": "TargetGroup", "Value": "targetgroup/EC2Co-Defau- EXAMPLEWNAD/89cc68152b367e5f" }, { "Name": "LoadBalancer", "Value": "app/EC2Co-EcsEl-EXAMPLE69Q/fdd2210e799e4376" } ] }, "Period": 300, "Stat": "Average" } } ] } Sample Response { "Messages": [], "MetricDataResults": [ { "Id": "m1", "Label": "Unhealthy Behind Load Balancer", "StatusCode": "Complete", "Timestamps": [ 1637074200, 1637073900, 1637073600 ], "Values": [ Examples API Version 2010-08-01 56 API Reference Amazon CloudWatch 0, 0, 0 ] }, { "Id": "q1", "Label": "Cluster CpuUtilization", "StatusCode": "Complete", "Timestamps": [ 1637074245, 1637073945, 1637073645 ], "Values": [ 1.2158469945359334, 0.8678863271635757, 0.7201860957623283 ] } ] } Example The following example includes a Metrics Insights query for that is given the ID error_rate. The returned results of the query are then used in the metric math expression to return availability. Sample Request { "StartTime": 1518867432, "EndTime": 1518868032, "MetricQueries": [ { "Id": "availability", "Expression": "(1 - error_rate) * 100", "Label": "Availability" }, { "Id": " error_rate", "Expression": "SELECT AVG(ErrorRate) FROM MyService", Examples API Version 2010-08-01 57 Amazon CloudWatch API Reference "Period": 300, "ReturnData": false } ] } Example The following example requests three separate metrics across two namespaces. The labels of the first two metrics use dynamic labels to display the peak value of CPUUtilization during the time shown on the graph, and also the time that the peak value was recorded. The Timezone setting specifies that the times shown in those dynamic labels reflect the United States Eastern time zone, which is 4 hours behind UTC. Sample Request { "StartTime": 1518867432, "EndTime": 1518868232, "LabelOptions": { "Timezone" : "-0400" }, "MetricDataQueries": [ { "Id": "m1", "Label": "CPUUtilization, peak of ${MAX} was at ${MAX_TIME}", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ] }, "Period": 300, "Stat": "Average" } }, { "Id": "m2", Examples API Version 2010-08-01 58 Amazon CloudWatch API Reference "Label": "CPUUtilization, peak of ${MAX} was at ${MAX_TIME}", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "InstanceId", "Value": "i-111111111111111111" } ] }, "Period": 300, "Stat": "Average" } }, { "Id": "m3", "MetricStat": { "Metric": { "Namespace": "AWS/ELB", "MetricName": "HealthyHostCount", "Dimensions": [ { "Name": "LoadBalancerName", "Value": "my-lb-B" } ] }, "Period": 300, "Stat": "Sum", "Unit": "None" } } ] } Sample Response { "MetricDataResults": [ { "Id": "m1", Examples |
acw-api-015 | acw-api.pdf | 15 | "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ] }, "Period": 300, "Stat": "Average" } }, { "Id": "m2", Examples API Version 2010-08-01 58 Amazon CloudWatch API Reference "Label": "CPUUtilization, peak of ${MAX} was at ${MAX_TIME}", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "InstanceId", "Value": "i-111111111111111111" } ] }, "Period": 300, "Stat": "Average" } }, { "Id": "m3", "MetricStat": { "Metric": { "Namespace": "AWS/ELB", "MetricName": "HealthyHostCount", "Dimensions": [ { "Name": "LoadBalancerName", "Value": "my-lb-B" } ] }, "Period": 300, "Stat": "Sum", "Unit": "None" } } ] } Sample Response { "MetricDataResults": [ { "Id": "m1", Examples API Version 2010-08-01 59 Amazon CloudWatch API Reference "StatusCode": "Complete", "Label": "CPUUtilization, peak of 31.5 was at 1-22 13:05", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 15000, 14000, 16000 ] }, { "Id": "m2", "StatusCode": "Complete", "Label": "CPUUtilization, peak of 63.2 was at 1-22 13:20", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 15, 14, 16 ] }, { "Id": "m3", "StatusCode": "Complete", "Label": "AWS/EC2 HealthyHostCount", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 15, 14, 16 ] } ] Examples API Version 2010-08-01 60 Amazon CloudWatch } Example API Reference The following example retrieves the NetworkOut metric for two Auto Scaling groups, and uses them in an expression. These two metrics are called m1 and m2, and the expression calculates e1 as the results of m2/m1. The raw values and time stamps of the NetworkOut metrics are not returned. Sample Request { "StartTime": 1518867432, "EndTime": 1518868232, "MetricQueries": [ { "Id": "e1", "Expression": "m2 / m1", "Label": "my-asg-B / my-asg-A" }, { "Id": "m1", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "NetworkOut", "Dimensions": [ { "Name": "AutoScalingGroupName", "Value": "my-asg-A" } ] }, "Period": 300, "Stat": "SampleCount", "Unit": "Bytes" }, "ReturnData": false }, { "Id": "m2", "MetricStat": { "Metric": { Examples API Version 2010-08-01 61 Amazon CloudWatch API Reference "Namespace": "AWS/EC2", "MetricName": "NetworkOut", "Dimensions": [ { "Name": "AutoScalingGroupName", "Value": "my-asg-B" } ] }, "Period": 300, "Stat": "SampleCount", "Unit": "Bytes" }, "ReturnData": false } ] } Sample Response { "MetricDataResults": [ { "Id": "m1", "StatusCode": "Complete" }, { "Id": "m2", "StatusCode": "Complete" }, { "Id": "e1", "StatusCode": "Complete", "Label": "my-asg-B / my-asg-A", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 100, 100, 100 Examples API Version 2010-08-01 62 Amazon CloudWatch ] } ] } Example API Reference In the following example, two levels of metric math expressions are used, with the result of one expression used as an input to the next expression: Sample Request { "StartTime": 1518867432, "EndTime": 1518868232, "MetricDataQueries": [ { "Id": "e1", "Expression": "e2 + m3", "Label": "my-asg-A * my-asg-B + my-asg-C" }, { "Id": "e2", "Expression": "m1 * m2", "Label": "my-asg-A * my-asg-B" }, { "Id": "m1", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "NetworkOut", "Dimensions": [ { "Name": "AutoScalingGroupName", "Value": "my-asg-A" } ] }, "Period": 300, "Stat": "SampleCount", "Unit": "Bytes" }, Examples API Version 2010-08-01 63 Amazon CloudWatch API Reference "ReturnData": false }, { "Id": "m2", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "NetworkOut", "Dimensions": [ { "Name": "AutoScalingGroupName", "Value": "my-asg-B" } ] }, "Period": 300, "Stat": "SampleCount", "Unit": "Bytes" }, "ReturnData": false }, { "Id": "m3", "MetricStat": { "Metric": { "Namespace": "AWS/EC2", "MetricName": "NetworkOut", "Dimensions": [ { "Name": "AutoScalingGroupName", "Value": "my-asg-C" } ] }, "Period": 300, "Stat": "SampleCount", "Unit": "Bytes" }, "ReturnData": false } ] } Examples API Version 2010-08-01 64 API Reference Amazon CloudWatch Sample Response { "MetricDataResults": [ { "Id": "m1", "StatusCode": "Complete" }, { "Id": "m2", "StatusCode": "Complete" }, { "Id": "m3", "StatusCode": "Complete" }, { "Id": "e1", "StatusCode": "Complete", "Label": "my-asg-A * my-asg-B + my-asg-C", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 200, 200, 200 ] }, { "Id": "e2", "StatusCode": "Complete", "Label": "my-asg-A * my-asg-B", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 100, 100, 100 Examples API Version 2010-08-01 65 Amazon CloudWatch ] } ] } Example API Reference In the following example, custom metrics are searched and assigned IDs that contain either "error" or "request", even if the original metric names did not contain those words. Then an error rate is calculated using the METRICS("string") function on the assigned IDs. Sample Request { "StartTime": 1518867432, "EndTime": 1518868432, "MetricDataQueries": [ { "Id": "errorRate", "Label": "Error Rate", "Expression": "errors/requests" }, { "Id": "errorRatePercent", "Label": "% Error Rate", "Expression": "errorRate*100" }, { "Id": "requests", "Expression": "SUM(METRICS('request'))", "ReturnData": false }, { "Id": "errors", "Expression": "SUM(METRICS('error'))", "ReturnData": false }, { "Id": "error1", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "BadRequests", Examples API Version 2010-08-01 66 Amazon CloudWatch API Reference "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, "Stat": "Sum" }, "ReturnData": false }, { "Id": "error2", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "ConnectionErrors", "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, "Stat": "Sum" }, "ReturnData": false }, { "Id": "request1", "MetricStat": { "Metric": |
acw-api-016 | acw-api.pdf | 16 | }, { "Id": "errorRatePercent", "Label": "% Error Rate", "Expression": "errorRate*100" }, { "Id": "requests", "Expression": "SUM(METRICS('request'))", "ReturnData": false }, { "Id": "errors", "Expression": "SUM(METRICS('error'))", "ReturnData": false }, { "Id": "error1", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "BadRequests", Examples API Version 2010-08-01 66 Amazon CloudWatch API Reference "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, "Stat": "Sum" }, "ReturnData": false }, { "Id": "error2", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "ConnectionErrors", "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, "Stat": "Sum" }, "ReturnData": false }, { "Id": "request1", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "InternalRequests", "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, Examples API Version 2010-08-01 67 API Reference Amazon CloudWatch "Stat": "Sum" }, "ReturnData": false }, { "Id": "request2", "MetricStat": { "Metric": { "Namespace": "MyService", "MetricName": "ExternalRequests", "Dimensions": [ { "Name": "Component", "Value": "component-1" } ] }, "Period": 60, "Stat": "Sum" }, "ReturnData": false } ] } Sample Response { "MetricDataResults": [ { "Id": "errorRate", "Label": "Error Rate", "StatusCode": "Complete", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 0.1, 0.5, 0.3 ] Examples API Version 2010-08-01 68 API Reference Amazon CloudWatch }, { "Id": "errorRatePercent", "Label": "% Error Rate", "StatusCode": "Complete", "Timestamps": [ 1518868032, 1518867732, 1518867432 ], "Values": [ 10, 50, 30 ] } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 69 Amazon CloudWatch GetMetricStatistics Gets statistics for the specified metric. API Reference The maximum number of data points returned from a single call is 1,440. If you request more than 1,440 data points, CloudWatch returns an error. To reduce the number of data points, you can narrow the specified time range and make multiple requests across adjacent time ranges, or you can increase the specified period. Data points are not returned in chronological order. CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request statistics with a one-hour period, CloudWatch aggregates all data points with time stamps that fall within each one-hour period. Therefore, the number of values aggregated by CloudWatch is larger than the number of data points returned. CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data if one of the following conditions is true: • The SampleCount value of the statistic set is 1. • The Min and the Max values of the statistic set are equal. Percentile statistics are not available for metrics when any of the metric values are negative numbers. Amazon CloudWatch retains metric data as follows: • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution metrics and are available only for custom metrics that have been defined with a StorageResolution of 1. • Data points with a period of 60 seconds (1-minute) are available for 15 days. • Data points with a period of 300 seconds (5-minute) are available for 63 days. • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months). Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, but is aggregated and GetMetricStatistics API Version 2010-08-01 70 Amazon CloudWatch API Reference retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour. CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, 2016. For information about metrics and dimensions supported by AWS services, see the Amazon CloudWatch Metrics and Dimensions Reference in the Amazon CloudWatch User Guide. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon |
acw-api-017 | acw-api.pdf | 17 | supported by AWS services, see the Amazon CloudWatch Metrics and Dimensions Reference in the Amazon CloudWatch User Guide. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying dimensions, see Publishing Metrics in the Amazon CloudWatch User Guide. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No EndTime The time stamp that determines the last data point to return. The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z). Type: Timestamp Required: Yes ExtendedStatistics.member.N The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics, you must specify either Statistics or ExtendedStatistics, but Request Parameters API Version 2010-08-01 71 Amazon CloudWatch API Reference not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 10 items. Required: No MetricName The name of the metric, with or without spaces. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Namespace The namespace of the metric, with or without spaces. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: Yes Period The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high- resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second. If the StartTime parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned: • Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). • Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes). Request Parameters API Version 2010-08-01 72 Amazon CloudWatch API Reference • Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour). Type: Integer Valid Range: Minimum value of 1. Required: Yes StartTime The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request. The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z). CloudWatch rounds the specified time stamp as follows: • Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00. • Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00. • Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00. If you set Period to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. Type: Timestamp Required: Yes Statistics.member.N The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics. When calling GetMetricStatistics, you must specify either Statistics or ExtendedStatistics, but not both. Request Parameters API Version 2010-08-01 73 Amazon CloudWatch Type: Array of strings API Reference Array Members: Minimum number of 1 item. Maximum number of 5 items. Valid Values: SampleCount | Average | Sum | Minimum | Maximum Required: No Unit The unit for a given metric. If you omit Unit, all data |
acw-api-018 | acw-api.pdf | 18 | previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. Type: Timestamp Required: Yes Statistics.member.N The metric statistics, other than percentile. For percentile statistics, use ExtendedStatistics. When calling GetMetricStatistics, you must specify either Statistics or ExtendedStatistics, but not both. Request Parameters API Version 2010-08-01 73 Amazon CloudWatch Type: Array of strings API Reference Array Members: Minimum number of 1 item. Maximum number of 5 items. Valid Values: SampleCount | Average | Sum | Minimum | Maximum Required: No Unit The unit for a given metric. If you omit Unit, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No Response Elements The following elements are returned by the service. Datapoints.member.N The data points for the specified metric. Type: Array of Datapoint objects Label A label for the specified metric. Type: String Response Elements API Version 2010-08-01 74 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 Errors API Version 2010-08-01 75 Amazon CloudWatch • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 76 Amazon CloudWatch GetMetricStream Returns information about the metric stream that you specify. Request Parameters API Reference For information about the parameters that are common to all actions, see Common Parameters. Name The name of the metric stream to retrieve information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Response Elements The following elements are returned by the service. Arn The ARN of the metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. CreationDate The date that the metric stream was created. Type: Timestamp ExcludeFilters.member.N If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream. Type: Array of MetricStreamFilter objects GetMetricStream API Version 2010-08-01 77 Amazon CloudWatch FirehoseArn API Reference The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. IncludeFilters.member.N If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream. Type: Array of MetricStreamFilter objects IncludeLinkedAccountsMetrics If this is true and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to. Type: Boolean LastUpdateDate The date of the most recent update to the metric stream's configuration. Type: Timestamp Name The name of the metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. OutputFormat The output format for the stream. Valid values are json, opentelemetry1.0, and opentelemetry0.7. For more information about metric stream output formats, see Metric streams output formats. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Response Elements API Version 2010-08-01 78 Amazon CloudWatch API Reference Valid Values: json | opentelemetry0.7 | opentelemetry1.0 RoleArn The ARN of the IAM role that is used by this metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. State The state of the metric stream. The possible values are running and stopped. Type: |
acw-api-019 | acw-api.pdf | 19 | length of 255. OutputFormat The output format for the stream. Valid values are json, opentelemetry1.0, and opentelemetry0.7. For more information about metric stream output formats, see Metric streams output formats. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Response Elements API Version 2010-08-01 78 Amazon CloudWatch API Reference Valid Values: json | opentelemetry0.7 | opentelemetry1.0 RoleArn The ARN of the IAM role that is used by this metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. State The state of the metric stream. The possible values are running and stopped. Type: String StatisticsConfigurations.member.N Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see CloudWatch statistics definitions. Type: Array of MetricStreamStatisticsConfiguration objects Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 Errors API Version 2010-08-01 79 API Reference Amazon CloudWatch MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 80 Amazon CloudWatch API Reference GetMetricWidgetImage You can use the GetMetricWidgetImage API to retrieve a snapshot graph of one or more Amazon CloudWatch metrics as a bitmap image. You can then embed this image into your services and products, such as wiki pages, reports, and documents. You could also retrieve images regularly, such as every minute, and create your own custom live dashboard. The graph you retrieve can include all CloudWatch metric graph features, including metric math and horizontal and vertical annotations. There is a limit of 20 transactions per second for this API. Each GetMetricWidgetImage action has the following limits: • As many as 100 metrics in the graph. • Up to 100 KB uncompressed payload. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. MetricWidget A JSON string that defines the bitmap graph to be retrieved. The string includes the metrics to include in the graph, statistics, annotations, title, axis limits, and so on. You can include only one MetricWidget parameter in each GetMetricWidgetImage call. For more information about the syntax of MetricWidget see GetMetricWidgetImage: Metric Widget Structure and Syntax. If any metric on the graph could not load all the requested data points, an orange triangle with an exclamation point appears next to the graph legend. Type: String Required: Yes OutputFormat The format of the resulting image. Only PNG images are supported. The default is png. If you specify png, the API returns an HTTP response with the content-type set to text/xml. The image data is in a MetricWidgetImage field. For example: GetMetricWidgetImage API Version 2010-08-01 81 Amazon CloudWatch API Reference <GetMetricWidgetImageResponse xmlns=<URLstring>> <GetMetricWidgetImageResult> <MetricWidgetImage> iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQEAYAAAAip... </MetricWidgetImage> </GetMetricWidgetImageResult> <ResponseMetadata> <RequestId>6f0d4192-4d42-11e8-82c1-f539a07e0e3b</RequestId> </ResponseMetadata> </GetMetricWidgetImageResponse> The image/png setting is intended only for custom HTTP requests. For most use cases, and all actions using an AWS SDK, you should use png. If you specify image/png, the HTTP response has a content-type set to image/png, and the body of the response is a PNG image. Type: String Required: No Response Elements The following element is returned by the service. MetricWidgetImage The image of the graph, in the output format specified. The output is base64-encoded. Type: Base64-encoded binary data object Errors For information about the errors that are common to all actions, see Common Errors. Response Elements API Version 2010-08-01 82 Amazon CloudWatch Examples Example API Reference The following is an example of a GetMetricWidgetImage call. This example displays a graph showing an image of the Average statistic for the CPUUtilization metric for two Amazon EC2 instances, with both horizontal and vertical annotations. { "OutputFormat":"png", "MetricWidget":"{\"width\":600,\"height\":395,\"metrics\":[[\"AWS/EC2\", \"CPUUtilization\",\"InstanceId\",\"i-1234567890abcdef0\",{\"stat\":\"Average\"}], [\"AWS/EC2\",\"CPUUtilization\",\"InstanceId\",\"i-0987654321abcdef0\",{\"stat\": \"Average\"}]],\"period\":300,\"start\":\"-P30D\",\"end\":\"PT0H\",\"stacked\":false, \"yAxis\":{\"left\":{\"min\":0.1,\"max\":1},\"right\":{\"min\":0}},\"title\":\"CPU for Two Instances\",\"annotations\":{\"horizontal\":[{\"color\":\"#ff6961\",\"label \":\"Trouble threshold start\",\"fill\":\"above\",\"value\":0.5}],\"vertical\": [{\"visible\":true,\"color\":\"#9467bd\",\"label\":\"Bug fix deployed\",\"value\": \"2018-08-28T15:25:26Z\",\"fill\":\"after\"}]}}" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for |
acw-api-020 | acw-api.pdf | 20 | API Reference The following is an example of a GetMetricWidgetImage call. This example displays a graph showing an image of the Average statistic for the CPUUtilization metric for two Amazon EC2 instances, with both horizontal and vertical annotations. { "OutputFormat":"png", "MetricWidget":"{\"width\":600,\"height\":395,\"metrics\":[[\"AWS/EC2\", \"CPUUtilization\",\"InstanceId\",\"i-1234567890abcdef0\",{\"stat\":\"Average\"}], [\"AWS/EC2\",\"CPUUtilization\",\"InstanceId\",\"i-0987654321abcdef0\",{\"stat\": \"Average\"}]],\"period\":300,\"start\":\"-P30D\",\"end\":\"PT0H\",\"stacked\":false, \"yAxis\":{\"left\":{\"min\":0.1,\"max\":1},\"right\":{\"min\":0}},\"title\":\"CPU for Two Instances\",\"annotations\":{\"horizontal\":[{\"color\":\"#ff6961\",\"label \":\"Trouble threshold start\",\"fill\":\"above\",\"value\":0.5}],\"vertical\": [{\"visible\":true,\"color\":\"#9467bd\",\"label\":\"Bug fix deployed\",\"value\": \"2018-08-28T15:25:26Z\",\"fill\":\"after\"}]}}" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Examples API Version 2010-08-01 83 Amazon CloudWatch ListDashboards API Reference Returns a list of the dashboards for your account. If you include DashboardNamePrefix, only those dashboards with names starting with the prefix are listed. Otherwise, all dashboards in your account are listed. ListDashboards returns up to 1000 results on one page. If there are more than 1000 dashboards, you can call ListDashboards again and include the value you received for NextToken in the first call, to receive the next 1000 results. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. DashboardNamePrefix If you specify this parameter, only the dashboards with names starting with the specified string are listed. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and "_". Type: String Required: No NextToken The token returned by a previous call to indicate that there is more data available. Type: String Required: No Response Elements The following elements are returned by the service. DashboardEntries.member.N The list of matching dashboards. Type: Array of DashboardEntry objects ListDashboards API Version 2010-08-01 84 Amazon CloudWatch NextToken API Reference The token that marks the start of the next batch of returned results. Type: String Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Errors API Version 2010-08-01 85 Amazon CloudWatch API Reference ListManagedInsightRules Returns a list that contains the number of managed Contributor Insights rules in your account. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. MaxResults The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is 100. Type: Integer Valid Range: Minimum value of 1. Maximum value of 500. Required: No NextToken Include this value to get the next set of rules if the value was returned by the previous operation. Type: String Required: No ResourceARN The ARN of an AWS resource that has managed Contributor Insights rules. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes Response Elements The following elements are returned by the service. ListManagedInsightRules API Version 2010-08-01 86 Amazon CloudWatch ManagedRules.member.N API Reference The managed rules that are available for the specified AWS resource. Type: Array of ManagedRuleDescription objects NextToken Include this value to get the next set of rules if the value was returned by the previous operation. Type: String Errors For information about the errors that are common to all actions, see Common Errors. InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET Errors API Version 2010-08-01 87 API Reference Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 88 Amazon CloudWatch ListMetrics API Reference List the specified metrics. You can use the returned metrics |
acw-api-021 | acw-api.pdf | 21 | information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET Errors API Version 2010-08-01 87 API Reference Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 88 Amazon CloudWatch ListMetrics API Reference List the specified metrics. You can use the returned metrics with GetMetricData or GetMetricStatistics to get statistical data. Up to 500 results are returned for any one call. To retrieve additional results, use the returned token with subsequent calls. After you create a metric, allow up to 15 minutes for the metric to appear. To see metric statistics sooner, use GetMetricData or GetMetricStatistics. If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view metrics from the linked source accounts. For more information, see CloudWatch cross-account observability. ListMetrics doesn't return information about metrics if those metrics haven't reported data in the past two weeks. To retrieve those metrics, use GetMetricData or GetMetricStatistics. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Dimensions.member.N The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned. Type: Array of DimensionFilter objects Array Members: Maximum number of 10 items. Required: No IncludeLinkedAccounts If you are using this operation in a monitoring account, specify true to include metrics from source accounts in the returned data. The default is false. Type: Boolean ListMetrics API Version 2010-08-01 89 Amazon CloudWatch Required: No MetricName API Reference The name of the metric to filter against. Only the metrics with names that match exactly will be returned. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace The metric namespace to filter against. Only the namespace that matches exactly will be returned. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No NextToken The token returned by a previous call to indicate that there is more data available. Type: String Required: No OwningAccount When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify true for IncludeLinkedAccounts. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Request Parameters API Version 2010-08-01 90 Amazon CloudWatch RecentlyActive API Reference To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of PT3H. This is the only valid value for this parameter. The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval. Type: String Valid Values: PT3H Required: No Response Elements The following elements are returned by the service. Metrics.member.N The metrics that match your request. Type: Array of Metric objects NextToken The token that marks the start of the next batch of returned results. Type: String OwningAccounts.member.N If you are using this operation in a monitoring account, this array contains the account IDs of the source accounts where the metrics in the returned data are from. This field is a 1:1 mapping between each metric that is returned and the ID of the owning account. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 255. Response Elements API Version 2010-08-01 91 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 Examples List metrics in a specified namespace from all source accounts and from the monitoring account The following example lists metrics in the AWS/EC2 namespace from the monitoring account itself and all source accounts. Sample Request { "IncludeLinkedAccounts": true, "Namespace" : "AWS/EC2" } List metrics from a namespace in just one source account The following example lists metrics in the AWS/EC2 namespace from only the source account with the ID 111111111111. Sample Request { "IncludeLinkedAccounts": "true", "OwningAccount" : "111111111111", Errors API Version 2010-08-01 92 Amazon CloudWatch "Namespace" : "AWS/EC2" } See Also API Reference For |
acw-api-022 | acw-api.pdf | 22 | out-of-range. HTTP Status Code: 400 Examples List metrics in a specified namespace from all source accounts and from the monitoring account The following example lists metrics in the AWS/EC2 namespace from the monitoring account itself and all source accounts. Sample Request { "IncludeLinkedAccounts": true, "Namespace" : "AWS/EC2" } List metrics from a namespace in just one source account The following example lists metrics in the AWS/EC2 namespace from only the source account with the ID 111111111111. Sample Request { "IncludeLinkedAccounts": "true", "OwningAccount" : "111111111111", Errors API Version 2010-08-01 92 Amazon CloudWatch "Namespace" : "AWS/EC2" } See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 93 Amazon CloudWatch ListMetricStreams Returns a list of metric streams in this account. Request Parameters API Reference For information about the parameters that are common to all actions, see Common Parameters. MaxResults The maximum number of results to return in one operation. Type: Integer Valid Range: Minimum value of 1. Maximum value of 500. Required: No NextToken Include this value, if it was returned by the previous call, to get the next set of metric streams. Type: String Required: No Response Elements The following elements are returned by the service. Entries.member.N The array of metric stream information. Type: Array of MetricStreamEntry objects NextToken The token that marks the start of the next batch of returned results. You can use this token in a subsequent operation to get the next batch of results. Type: String ListMetricStreams API Version 2010-08-01 94 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidNextToken The next token specified is invalid. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 Errors API Version 2010-08-01 95 Amazon CloudWatch • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 96 Amazon CloudWatch API Reference ListTagsForResource Displays the tags associated with a CloudWatch resource. Currently, alarms and Contributor Insights rules support tagging. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ResourceARN The ARN of the CloudWatch resource that you want to view tags for. The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm- name The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account- id:insight-rule/insight-rule-name For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes Response Elements The following element is returned by the service. Tags.member.N The list of tag keys and values associated with the resource you specified. Type: Array of Tag objects Errors For information about the errors that are common to all actions, see Common Errors. ListTagsForResource API Version 2010-08-01 97 Amazon CloudWatch InternalServiceError API Reference Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 98 Amazon CloudWatch API Reference PutAnomalyDetector Creates an anomaly detection model for a CloudWatch metric. You can use the model to display a band of expected normal values when the metric is graphed. If you have enabled unified cross-account observability, and |
acw-api-023 | acw-api.pdf | 23 | AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 98 Amazon CloudWatch API Reference PutAnomalyDetector Creates an anomaly detection model for a CloudWatch metric. You can use the model to display a band of expected normal values when the metric is graphed. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account. You can specify the account ID in the object you specify in the SingleMetricAnomalyDetector parameter. For more information, see CloudWatch Anomaly Detection. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Configuration The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges. The configuration can also include the time zone to use for the metric. Type: AnomalyDetectorConfiguration object Required: No Dimensions.member.N This parameter has been deprecated. The metric dimensions to create the anomaly detection model for. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MetricCharacteristics Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the PeriodicSpikes parameter. PutAnomalyDetector API Version 2010-08-01 99 Amazon CloudWatch API Reference Type: MetricCharacteristics object Required: No MetricMathAnomalyDetector The metric math anomaly detector to be created. When using MetricMathAnomalyDetector, you cannot include the following parameters in the same operation: • Dimensions • MetricName • Namespace • Stat • the SingleMetricAnomalyDetector parameters of PutAnomalyDetectorInput Instead, specify the metric math anomaly detector attributes as part of the property MetricMathAnomalyDetector. Type: MetricMathAnomalyDetector object Required: No MetricName This parameter has been deprecated. The name of the metric to create the anomaly detection model for. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace This parameter has been deprecated. The namespace of the metric to create the anomaly detection model for. Type: String Request Parameters API Version 2010-08-01 100 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No SingleMetricAnomalyDetector A single metric anomaly detector to be created. When using SingleMetricAnomalyDetector, you cannot include the following parameters in the same operation: • Dimensions • MetricName • Namespace • Stat • the MetricMathAnomalyDetector parameters of PutAnomalyDetectorInput Instead, specify the single metric anomaly detector attributes as part of the property SingleMetricAnomalyDetector. Type: SingleMetricAnomalyDetector object Required: No Stat This parameter has been deprecated. The statistic to use for the metric and the anomaly detection model. Type: String Length Constraints: Maximum length of 50. Pattern: (SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm) (\d{1,2}(\.\d{0,10})?|100)|[ou]\d+(\.\d*)?)(_E|_L|_H)?|(TM|TC|TS| WM)\(((((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?:((\d{1,2})(\. \d{0,10})?|100(\.0{0,10})?)%|((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%: (((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?)\)|(TM|TC|TS|WM|PR)\(((\d +(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)):((\d+(\.\d{0,10})?|(\d Request Parameters API Version 2010-08-01 101 Amazon CloudWatch API Reference +(\.\d{0,10})?[Ee][+-]?\d+)))?|((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee] [+-]?\d+)))?:(\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))\) Required: No Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 LimitExceeded The operation exceeded one or more limits. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: Errors API Version 2010-08-01 102 API Reference Amazon CloudWatch • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 103 Amazon CloudWatch API Reference PutCompositeAlarm Creates or updates a composite alarm. When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met. The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms. The rule expression of a composite alarm can include as many as 100 underlying alarms. Any single alarm can be included in the rule expressions of as many as 150 composite alarms. Using composite alarms can reduce |
acw-api-024 | acw-api.pdf | 24 | composite alarm. When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met. The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms. The rule expression of a composite alarm can include as many as 100 underlying alarms. Any single alarm can be included in the rule expressions of as many as 150 composite alarms. Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, you could create a composite alarm that goes into ALARM state only when more than one of the underlying metric alarms are in ALARM state. Composite alarms can take the following actions: • Notify Amazon SNS topics. • Invoke Lambda functions. • Create OpsItems in Systems Manager Ops Center. • Create incidents in Systems Manager Incident Manager. Note It is possible to create a loop or cycle of composite alarms, where composite alarm A depends on composite alarm B, and composite alarm B also depends on composite alarm A. In this scenario, you can't delete any composite alarm that is part of the cycle because there is always still a composite alarm that depends on that alarm that you want to delete. To get out of such a situation, you must break the cycle by changing the rule of one of the composite alarms in the cycle to remove a dependency that creates the cycle. The simplest change to make to break a cycle is to change the AlarmRule of one of the alarms to false. Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the evaluation path. PutCompositeAlarm API Version 2010-08-01 104 Amazon CloudWatch API Reference When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. For a composite alarm, this initial time after creation is the only time that the alarm can be in INSUFFICIENT_DATA state. When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm. To use this operation, you must be signed on with the cloudwatch:PutCompositeAlarm permission that is scoped to *. You can't create a composite alarms if your cloudwatch:PutCompositeAlarm permission has a narrower scope. If you are an IAM user, you must have iam:CreateServiceLinkedRole to create a composite alarm that has Systems Manager OpsItem actions. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ActionsEnabled Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is TRUE. Type: Boolean Required: No ActionsSuppressor Actions will be suppressed if the suppressor alarm is in the ALARM state. ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 1600. Required: No ActionsSuppressorExtensionPeriod The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the ALARM state. After this time, the composite alarm performs its actions. Request Parameters API Version 2010-08-01 105 Amazon CloudWatch API Reference Important ExtensionPeriod is required only when ActionsSuppressor is specified. Type: Integer Required: No ActionsSuppressorWaitPeriod The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the ALARM state. After this time, the composite alarm performs its actions. Important WaitPeriod is required only when ActionsSuppressor is specified. Type: Integer Required: No AlarmActions.member.N The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid Values: ] Amazon SNS actions: arn:aws:sns:region:account-id:sns-topic-name Lambda actions: • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name Request Parameters API Version 2010-08-01 106 Amazon CloudWatch Systems Manager actions: API Reference arn:aws:ssm:region:account-id:opsitem:severity Start a Amazon Q Developer operational investigation arn:aws:aiops:region:account-id:investigation-group:investigation-group- id Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmDescription The description for the composite alarm. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No AlarmName The name for the composite alarm. This name must be unique within the Region. Type: String Length Constraints: Minimum length of 1. Maximum length of |
acw-api-025 | acw-api.pdf | 25 | using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name Request Parameters API Version 2010-08-01 106 Amazon CloudWatch Systems Manager actions: API Reference arn:aws:ssm:region:account-id:opsitem:severity Start a Amazon Q Developer operational investigation arn:aws:aiops:region:account-id:investigation-group:investigation-group- id Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmDescription The description for the composite alarm. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No AlarmName The name for the composite alarm. This name must be unique within the Region. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes AlarmRule An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression. Request Parameters API Version 2010-08-01 107 Amazon CloudWatch API Reference You can use either alarm names or ARNs to reference the other alarms that are to be evaluated. Functions can include the following: • ALARM("alarm-name or alarm-ARN") is TRUE if the named alarm is in ALARM state. • OK("alarm-name or alarm-ARN") is TRUE if the named alarm is in OK state. • INSUFFICIENT_DATA("alarm-name or alarm-ARN") is TRUE if the named alarm is in INSUFFICIENT_DATA state. • TRUE always evaluates to TRUE. • FALSE always evaluates to FALSE. TRUE and FALSE are useful for testing a complex AlarmRule structure, and for testing your alarm actions. Alarm names specified in AlarmRule can be surrounded with double-quotes ("), but do not have to be. The following are some examples of AlarmRule: • ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh) specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state. • ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress) specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window. • (ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh) goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring. The AlarmRule can specify as many as 100 "children" alarms. The AlarmRule expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses. Type: String Length Constraints: Minimum length of 1. Maximum length of 10240. Request Parameters API Version 2010-08-01 108 Amazon CloudWatch Required: Yes InsufficientDataActions.member.N API Reference The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid Values: ] Amazon SNS actions: arn:aws:sns:region:account-id:sns-topic-name Lambda actions: • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No OKActions.member.N The actions to execute when this alarm transitions to an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid Values: ] Amazon SNS actions: arn:aws:sns:region:account-id:sns-topic-name Lambda actions: Request Parameters API Version 2010-08-01 109 Amazon CloudWatch API Reference • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No Tags.member.N A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the cloudwatch:TagResource permission. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource. Type: Array of Tag objects Required: No Errors For information about the errors that are common to |
acw-api-026 | acw-api.pdf | 26 | able to associate tags with the alarm when you create the alarm, you must have the cloudwatch:TagResource permission. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource. Type: Array of Tag objects Required: No Errors For information about the errors that are common to all actions, see Common Errors. LimitExceeded The quota for alarms for this customer has already been reached. Errors API Version 2010-08-01 110 Amazon CloudWatch HTTP Status Code: 400 Examples Composite alarm example API Reference The following example creates an alarm that notifies an SNS group when either of two specified metric alarms exceeds its threshold. Sample Request { "AlarmDescription": "The host is experiencing problems", "AlarmRule": "ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)", "AlarmName": "overall-health-alarm", "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic" ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Examples API Version 2010-08-01 111 Amazon CloudWatch PutDashboard API Reference Creates a dashboard if it does not already exist, or updates an existing dashboard. If you update a dashboard, the entire contents are replaced with what you specify here. All dashboards in your account are global, not region-specific. A simple way to create a dashboard using PutDashboard is to copy an existing dashboard. To copy an existing dashboard using the console, you can load the dashboard and then use the View/edit source command in the Actions menu to display the JSON block for that dashboard. Another way to copy a dashboard is to use GetDashboard, and then use the data returned within DashboardBody as the template for the new dashboard when you call PutDashboard. When you create a dashboard with PutDashboard, a good practice is to add a text widget at the top of the dashboard with a message that the dashboard was created by script and should not be changed in the console. This message could also point console users to the location of the DashboardBody script or the CloudFormation template used to create the dashboard. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. DashboardBody The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard. This parameter is required. For more information about the syntax, see Dashboard Body Structure and Syntax. Type: String Required: Yes DashboardName The name of the dashboard. If a dashboard with this name already exists, this call modifies that dashboard, replacing its current contents. Otherwise, a new dashboard is created. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, "-", and "_". This parameter is required. Type: String Required: Yes PutDashboard API Version 2010-08-01 112 Amazon CloudWatch Response Elements The following element is returned by the service. DashboardValidationMessages.member.N API Reference If the input for PutDashboard was correct and the dashboard was successfully created or modified, this result is empty. If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render. If this result includes error messages, the input was not valid and the operation failed. Type: Array of DashboardValidationMessage objects Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterInput Some part of the dashboard data is invalid. HTTP Status Code: 400 Examples Example The following example creates a dashboard with just one text widget. { "DashboardName":"Dashboard with only one text widget", "DashboardBody":{ "widgets":[ { Response Elements API Version 2010-08-01 113 API Reference Amazon CloudWatch "type":"text", "x":0, "y":7, "width":3, "height":3, "properties":{ "markdown":"Hello world" } } ] } } Example The following example modifies an existing dashboard to include one metric widget and one text widget. { "DashboardName": "Two-Widget Dashboard", "DashboardBody": { "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" } }, Examples API Version 2010-08-01 114 API Reference Amazon CloudWatch { "type": "text", "x": 0, "y": 7, |
acw-api-027 | acw-api.pdf | 27 | "widgets":[ { Response Elements API Version 2010-08-01 113 API Reference Amazon CloudWatch "type":"text", "x":0, "y":7, "width":3, "height":3, "properties":{ "markdown":"Hello world" } } ] } } Example The following example modifies an existing dashboard to include one metric widget and one text widget. { "DashboardName": "Two-Widget Dashboard", "DashboardBody": { "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" } }, Examples API Version 2010-08-01 114 API Reference Amazon CloudWatch { "type": "text", "x": 0, "y": 7, "width": 3, "height": 3, "properties": { "markdown": "Hello world" } } ] } } Example The following example creates a dashboard with two metric widgets, side by side. { "DashboardName": "Two-metric-widget Dashboard", "DashboardBody": { "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" } }, Examples API Version 2010-08-01 115 API Reference Amazon CloudWatch { "type": "metric", "x": 12, "y": 0, "width": 12, "height": 6, "properties": { "metrics": [ [ "AWS/S3", "BucketSizeBytes", "BucketName", "amzn-s3-demo-bucket" ] ], "period": 86400, "stat": "Maximum", "region": "us-east-1", "title": "amzn-s3-demo-bucket bytes" } } ] } } Example The following example creates a dashboard with one widget at the top that shows the DiskReadBytes metric for three EC2 instances on one graph, and a separate widget below that, with an alarm. { "DashboardName": "Dashboard with a three-metric graph and an alarm", "DashboardBody": { "widgets": [ { "type": "metric", "x": 0, "y": 0, "width": 12, "height": 6, "properties": { "metrics": [ Examples API Version 2010-08-01 116 Amazon CloudWatch API Reference [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-xyz" ], [ ".", ".", ".", "i-abc" ], [ ".", ".", ".", "i-123" ] ], "period": 300, "stat": "Average", "region": "us-east-1", "title": "EC2 Instance CPU" } }, { "type": "metric", "x": 0, "y": 7, "width": 12, "height": 12, "properties": { "annotations": { "alarms": [ "arn:aws:cloudwatch:us-east-1:123456789012:alarm:myalarm" ] }, "period": 60, "title": "MyAlarm" } } ] } Examples API Version 2010-08-01 117 Amazon CloudWatch } Example API Reference The following example creates a dashboard with one metric widget and one metric math widget. { "DashboardName":" One metric math widget and One metric widget", "DashboardBody":{ "widgets":[ { "type":"metric", "x":0, "y":0, "width":6, "height":6, "properties":{ "metrics":[ [ "AWS/EC2", "CPUUtilization", "InstanceId", "i-012345" ] ], "region":"us-east-1", "stat":"Average", "period":300, "title":"EC2 Instance CPU" } }, { "type":"metric", "x":6, "y":0, "width":6, "height":6, "properties":{ "metrics":[ [ { "expression":"SUM(METRICS())", "label":"Expression1", Examples API Version 2010-08-01 118 Amazon CloudWatch API Reference "id":"e1", "visible":true } ], [ "AWS/EC2", "CPUUtilization", "InstanceId", "i-xyz", { "id":"m1", "visible":true } ], [ "...", "i-abc", { "id":"m2", "visible":true } ], [ "...", "i-123", { "id":"m3", "visible":true } ], [ "...", "i-456", { "id":"m4", "visible":true } ] ], "region":"us-east-1", "stat":"Average", "period":300, "title":"Sum of CPUUtilization of four Instances" } Examples API Version 2010-08-01 119 Amazon CloudWatch } ] } } See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 120 Amazon CloudWatch PutInsightRule API Reference Creates a Contributor Insights rule. Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see Using Contributor Insights to Analyze High-Cardinality Data. If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. RuleDefinition The definition of the rule, as a JSON object. For details on the valid syntax, see Contributor Insights Rule Syntax. Type: String Length Constraints: Minimum length of 1. Maximum length of 8192. Pattern: [\x00-\x7F]+ Required: Yes RuleName A unique name for the rule. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes RuleState The state of the rule. Valid values are ENABLED and DISABLED. Type: String PutInsightRule API Version 2010-08-01 121 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: No Tags.member.N A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by |
acw-api-028 | acw-api.pdf | 28 | name for the rule. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes RuleState The state of the rule. Valid values are ENABLED and DISABLED. Type: String PutInsightRule API Version 2010-08-01 121 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: No Tags.member.N A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values. To be able to associate tags with a rule, you must have the cloudwatch:TagResource permission in addition to the cloudwatch:PutInsightRule permission. If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use TagResource. Type: Array of Tag objects Required: No Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 LimitExceeded The operation exceeded one or more limits. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. Errors API Version 2010-08-01 122 Amazon CloudWatch HTTP Status Code: 400 See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 123 Amazon CloudWatch API Reference PutManagedInsightRules Creates a managed Contributor Insights rule for a specified AWS resource. When you enable a managed rule, you create a Contributor Insights rule that collects data from AWS services. You cannot edit these rules with PutInsightRule. The rules can be enabled, disabled, and deleted using EnableInsightRules, DisableInsightRules, and DeleteInsightRules. If a previously created managed rule is currently disabled, a subsequent call to this API will re-enable it. Use ListManagedInsightRules to describe all available rules. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ManagedRules.member.N A list of ManagedRules to enable. Type: Array of ManagedRule objects Required: Yes Response Elements The following element is returned by the service. Failures.member.N An array that lists the rules that could not be enabled. Type: Array of PartialFailure objects Errors For information about the errors that are common to all actions, see Common Errors. InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 PutManagedInsightRules API Version 2010-08-01 124 Amazon CloudWatch MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 125 Amazon CloudWatch PutMetricAlarm API Reference Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, or Metrics Insights query. For more information about using a Metrics Insights query for an alarm, see Create alarms on Metrics Insights queries. Alarms based on anomaly detection models cannot have Auto Scaling actions. When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm. If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations: • The iam:CreateServiceLinkedRole permission for all alarms with EC2 actions • The iam:CreateServiceLinkedRole permissions to create an alarm with Systems Manager OpsItem or response plan actions. The first time you create an alarm in the AWS Management Console, the AWS CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called AWSServiceRoleForCloudWatchEvents and AWSServiceRoleForCloudWatchAlarms_ActionSSM. For more information, see AWS service- linked role. Each PutMetricAlarm action has a maximum uncompressed payload of 120 KB. |
acw-api-029 | acw-api.pdf | 29 | the alarm. If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations: • The iam:CreateServiceLinkedRole permission for all alarms with EC2 actions • The iam:CreateServiceLinkedRole permissions to create an alarm with Systems Manager OpsItem or response plan actions. The first time you create an alarm in the AWS Management Console, the AWS CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called AWSServiceRoleForCloudWatchEvents and AWSServiceRoleForCloudWatchAlarms_ActionSSM. For more information, see AWS service- linked role. Each PutMetricAlarm action has a maximum uncompressed payload of 120 KB. Cross-account alarms You can set an alarm on metrics in the current account, or in another account. To create a cross- account alarm that watches a metric in a different account, you must have completed the following pre-requisites: • The account where the metrics are located (the sharing account) must already have a sharing role named CloudWatch-CrossAccountSharingRole. If it does not already have this role, you must create it using the instructions in Set up a sharing account in Cross-account cross-Region CloudWatch console. The policy for that role must grant access to the ID of the account where you are creating the alarm. PutMetricAlarm API Version 2010-08-01 126 Amazon CloudWatch API Reference • The account where you are creating the alarm (the monitoring account) must already have a service-linked role named AWSServiceRoleForCloudWatchCrossAccount to allow CloudWatch to assume the sharing role in the sharing account. If it does not, you must create it following the directions in Set up a monitoring account in Cross-account cross-Region CloudWatch console. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ActionsEnabled Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE. Type: Boolean Required: No AlarmActions.member.N The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values: EC2 actions: • arn:aws:automate:region:ec2:stop • arn:aws:automate:region:ec2:terminate • arn:aws:automate:region:ec2:reboot • arn:aws:automate:region:ec2:recover • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Stop/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Terminate/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Reboot/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Recover/1.0 Autoscaling action: Request Parameters API Version 2010-08-01 127 Amazon CloudWatch API Reference • arn:aws:autoscaling:region:account-id:scalingPolicy:policy- id:autoScalingGroupName/group-friendly-name:policyName/policy- friendly-name Lambda actions: • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name SNS notification action: • arn:aws:sns:region:account-id:sns-topic-name SSM integration actions: • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name Start a Amazon Q Developer operational investigation arn:aws:aiops:region:account-id:investigation-group:investigation-group- id Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmDescription The description for the alarm. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Request Parameters API Version 2010-08-01 128 Amazon CloudWatch Required: No AlarmName API Reference The name for the alarm. This name must be unique within the Region. The name must contain only UTF-8 characters, and can't contain ASCII control characters Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes ComparisonOperator The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand. The values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models. Type: String Valid Values: GreaterThanOrEqualToThreshold | GreaterThanThreshold | LessThanThreshold | LessThanOrEqualToThreshold | LessThanLowerOrGreaterThanUpperThreshold | LessThanLowerThreshold | GreaterThanUpperThreshold Required: Yes DatapointsToAlarm The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide. Type: Integer Valid Range: Minimum value of 1. Required: No Request Parameters API Version 2010-08-01 129 API Reference Amazon CloudWatch Dimensions.member.N The dimensions for the metric specified in MetricName. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No EvaluateLowSampleCountPercentile Used only for alarms based on percentiles. If you specify ignore, the alarm state does not change during periods with too few data points to be statistically significant. If you specify evaluate or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples. Valid Values: evaluate | ignore Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No EvaluationPeriods The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting |
acw-api-030 | acw-api.pdf | 30 | significant. If you specify evaluate or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples. Valid Values: evaluate | ignore Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No EvaluationPeriods The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N. Type: Integer Valid Range: Minimum value of 1. Required: Yes ExtendedStatistic The extended statistic for the metric specified in MetricName. When you call PutMetricAlarm and specify a MetricName, you must specify either Statistic or ExtendedStatistic but not both. Request Parameters API Version 2010-08-01 130 Amazon CloudWatch API Reference If you specify ExtendedStatistic, the following are valid values: • p90 • tm90 • tc90 • ts90 • wm90 • IQM • PR(n:m) where n and m are values of the metric • TC(X%:X%) where X is between 10 and 90 inclusive. • TM(X%:X%) where X is between 10 and 90 inclusive. • TS(X%:X%) where X is between 10 and 90 inclusive. • WM(X%:X%) where X is between 10 and 90 inclusive. For more information about these extended statistics, see CloudWatch statistics definitions. Type: String Required: No InsufficientDataActions.member.N The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values: EC2 actions: • arn:aws:automate:region:ec2:stop • arn:aws:automate:region:ec2:terminate • arn:aws:automate:region:ec2:reboot • arn:aws:automate:region:ec2:recover • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Stop/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Terminate/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Reboot/1.0 Request Parameters API Version 2010-08-01 131 Amazon CloudWatch API Reference • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Recover/1.0 Autoscaling action: • arn:aws:autoscaling:region:account-id:scalingPolicy:policy- id:autoScalingGroupName/group-friendly-name:policyName/policy- friendly-name Lambda actions: • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name SNS notification action: • arn:aws:sns:region:account-id:sns-topic-name SSM integration actions: • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No MetricName The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName or a Metrics array. If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the Namespace, Dimensions, Period, Unit, Statistic, or ExtendedStatistic parameters. Instead, you specify all this information in the Metrics array. Request Parameters API Version 2010-08-01 132 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Metrics.member.N An array of MetricDataQuery structures that enable you to create an alarm based on the result of a metric math expression. For each PutMetricAlarm operation, you must specify either MetricName or a Metrics array. Each item in the Metrics array either retrieves a metric or performs a math expression. One item in the Metrics array is the expression that the alarm watches. You designate this expression by setting ReturnData to true for this object in the array. For more information, see MetricDataQuery. If you use the Metrics parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, or ExtendedStatistic parameters of PutMetricAlarm in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the Metrics array. Type: Array of MetricDataQuery objects Required: No Namespace The namespace for the metric associated specified in MetricName. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No OKActions.member.N The actions to execute when this alarm transitions to an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values: EC2 actions: Request Parameters API Version 2010-08-01 133 Amazon CloudWatch API Reference • arn:aws:automate:region:ec2:stop • arn:aws:automate:region:ec2:terminate • arn:aws:automate:region:ec2:reboot • arn:aws:automate:region:ec2:recover • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Stop/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Terminate/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Reboot/1.0 • arn:aws:swf:region:account-id:action/actions/ AWS_EC2.InstanceId.Recover/1.0 Autoscaling action: • arn:aws:autoscaling:region:account-id:scalingPolicy:policy- id:autoScalingGroupName/group-friendly-name:policyName/policy- friendly-name Lambda actions: • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name SNS notification action: • arn:aws:sns:region:account-id:sns-topic-name SSM integration actions: • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name Type: Array of strings Array Members: Maximum number of 5 items. Request Parameters API Version 2010-08-01 134 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No Period The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 30, and any multiple |
acw-api-031 | acw-api.pdf | 31 | latest version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account- id:function:function-name:version-number • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account- id:function:function-name:alias-name SNS notification action: • arn:aws:sns:region:account-id:sns-topic-name SSM integration actions: • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name Type: Array of strings Array Members: Maximum number of 5 items. Request Parameters API Version 2010-08-01 134 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No Period The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 30, and any multiple of 60. Period is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the Metrics array. Be sure to specify 10, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10, 20, or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing. An alarm's total current evaluation period can be no longer than seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds). Type: Integer Valid Range: Minimum value of 10. Required: No Statistic The statistic for the metric specified in MetricName, other than percentile. For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm and specify a MetricName, you must specify either Statistic or ExtendedStatistic, but not both. Type: String Valid Values: SampleCount | Average | Sum | Minimum | Maximum Required: No Request Parameters API Version 2010-08-01 135 Amazon CloudWatch Tags.member.N API Reference A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the cloudwatch:TagResource permission. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource. To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions. Type: Array of Tag objects Required: No Threshold 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. Type: Double Required: No ThresholdMetricId If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function. For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page. If your alarm uses this parameter, it cannot have Auto Scaling actions. Type: String Request Parameters API Version 2010-08-01 136 Amazon CloudWatch API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Required: No TreatMissingData Sets how this alarm is to handle missing data points. If TreatMissingData is omitted, the default behavior of missing is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data. Valid Values: breaching | notBreaching | ignore | missing Note Alarms that evaluate metrics in the AWS/DynamoDB namespace always ignore missing data even if you choose a different option for TreatMissingData. When an AWS/ DynamoDB metric has missing data, alarms that evaluate that metric remain in their current state. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Unit The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math |
acw-api-032 | acw-api.pdf | 32 | remain in their current state. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Unit The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the Metrics array. If you don't specify Unit, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended. However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves unpredictably. Request Parameters API Version 2010-08-01 137 Amazon CloudWatch API Reference We recommend omitting Unit so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA state. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No Errors For information about the errors that are common to all actions, see Common Errors. LimitExceeded The quota for alarms for this customer has already been reached. HTTP Status Code: 400 Examples Static Threshold Alarm The following example creates an alarm that notifies an SNS group when the CPUUtilization of a certain instance goes over 40% for three out of four periods. Sample Request { "Namespace": "AWS/EC2", "MetricName": "CPUUtilization", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" Errors API Version 2010-08-01 138 API Reference Amazon CloudWatch } ], "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic" ], "ComparisonOperator": "GreaterThanThreshold", "DatapointsToAlarm": 3, "EvaluationPeriods": 4, "Period": 60, "Statistic": "Average", "Threshold": 40, "AlarmDescription": "CPU Utilization of i-1234567890abcdef0 with 40% as threshold", "AlarmName": "Instance i-1234567890abcdef0 CPU Utilization" } Metric Math Function Alarm The following example retrieves three metrics that each track a different type of connection error to a custom service. These error counts are first summed in one expression, then divided by total connection attempts in another expression. The alarm goes to the ALARM state if the error rate is over 40% for three consecutive periods, and notifies two different SNS groups. Sample Request { "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic", "arn:aws:sns:us-west-1:123456789012:my_other_sns_topic" ], "ComparisonOperator": "GreaterThanThreshold", "EvaluationPeriods": 3, "Threshold": 40, "AlarmDescription": "MyService Aggregate Connection Error Rate (Alarm at 40%)", "AlarmName": "MyService Connection Error Rate", "Metrics": [ { "MetricStat": { "Metric": { "MetricName": "ConnectionsFailed", "Namespace": "MyService" }, "Period": 60, "Stat": "Sum" Examples API Version 2010-08-01 139 API Reference Amazon CloudWatch }, "Id": "m1", "ReturnData": "False" }, { "MetricStat": { "Metric": { "MetricName": "ConnectionsDropped", "Namespace": "MyService" }, "Period": 60, "Stat": "Sum" }, "Id": "m2", "ReturnData": "False" }, { "MetricStat": { "Metric": { "MetricName": "RequestsThrottled", "Namespace": "MyService" }, "Period": 60, "Stat": "Sum" }, "Id": "m3", "ReturnData": "False" }, { "MetricStat": { "Metric": { "MetricName": "ConnectionAttempts", "Namespace": "MyService" }, "Period": 60, "Stat": "Sum" }, "Id": "m4", "ReturnData": "False" }, { "Id": "error_total", "Expression": "m1+m2+m3", "ReturnData": "False" Examples API Version 2010-08-01 140 API Reference Amazon CloudWatch }, { "Id": "error_rate", "Expression": "(error_total/m4)*100", "ReturnData": "true", "Label": "Total Connection Error Rate" } ] } Anomaly Detection Model Alarm The following example sets an alarm on an anomaly detection model. The Id of m1 is assigned to the CPUUtilization metric of an instance. t1 is the anomaly detection model function for that metric, and uses 3 standard deviations to set the width of the band. The setting of ThresholdMetricId is t1 and the ComparisonOperator is LessThanLowerOrGreaterThanUpperThreshold, specifying that the alarm goes to alarm state when the metric value is outside the anomaly model band in either direction for two consecutive evaluation periods. Sample Request { "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic", "arn:aws:sns:us-west-1:123456789012:my_other_sns_topic" ], "AlarmName": "MyAlarmName", "AlarmDescription": "This alarm uses an anomaly detection model", "Metrics": [ { "Id": "m1", "ReturnData": true, "MetricStat": { "Metric": { "MetricName": "CPUUtilization", "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "instanceId", "Value": "i-1234567890abcdef0" } Examples API Version 2010-08-01 141 Amazon CloudWatch API Reference ] }, "Stat": "Average", "Period": 60 } }, { "Id": "t1", "Expression": "ANOMALY_DETECTION_BAND(m1, 3)" } ], "EvaluationPeriods": 2, "ThresholdMetricId": "t1", "ComparisonOperator": "LessThanLowerOrGreaterThanUpperThreshold" } Metrics Insights query alarm The following example sets an alarm on an Metrics Insights query. Sample Request { "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic", "arn:aws:sns:us-west-1:123456789012:my_other_sns_topic" |
acw-api-033 | acw-api.pdf | 33 | for two consecutive evaluation periods. Sample Request { "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic", "arn:aws:sns:us-west-1:123456789012:my_other_sns_topic" ], "AlarmName": "MyAlarmName", "AlarmDescription": "This alarm uses an anomaly detection model", "Metrics": [ { "Id": "m1", "ReturnData": true, "MetricStat": { "Metric": { "MetricName": "CPUUtilization", "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "instanceId", "Value": "i-1234567890abcdef0" } Examples API Version 2010-08-01 141 Amazon CloudWatch API Reference ] }, "Stat": "Average", "Period": 60 } }, { "Id": "t1", "Expression": "ANOMALY_DETECTION_BAND(m1, 3)" } ], "EvaluationPeriods": 2, "ThresholdMetricId": "t1", "ComparisonOperator": "LessThanLowerOrGreaterThanUpperThreshold" } Metrics Insights query alarm The following example sets an alarm on an Metrics Insights query. Sample Request { "AlarmActions": [ "arn:aws:sns:us-west-1:123456789012:my_sns_topic", "arn:aws:sns:us-west-1:123456789012:my_other_sns_topic" ], "AlarmName": "MetricsInsightsAlarm", "AlarmDescription": "This alarm uses a Metrics Insights query", "Metrics": [ { "Id": "m1", "Expression": "SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId)", "Period": 60, "Label": "Average CPUUtilization query" } ], "EvaluationPeriods": 1, "Threshold": 65, "ComparisonOperator": "GreaterThanThreshold" } Examples API Version 2010-08-01 142 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 143 Amazon CloudWatch PutMetricData API Reference Publishes metric data to Amazon CloudWatch. CloudWatch associates the data with the specified metric. If the specified metric does not exist, CloudWatch creates the metric. When CloudWatch creates a metric, it can take up to fifteen minutes for the metric to appear in calls to ListMetrics. You can publish metrics with associated entity data (so that related telemetry can be found and viewed together), or publish metric data by itself. To send entity data with your metrics, use the EntityMetricData parameter. To send metrics without entity data, use the MetricData parameter. The EntityMetricData structure includes MetricData structures for the metric data. You can publish either individual values in the Value field, or arrays of values and the number of times each value occurred during the period by using the Values and Counts fields in the MetricData structure. Using the Values and Counts method enables you to publish up to 150 values per metric with one PutMetricData request, and supports retrieving percentile statistics on this data. Each PutMetricData request is limited to 1 MB in size for HTTP POST requests. You can send a payload compressed by gzip. Each request is also limited to no more than 1000 different metrics (across both the MetricData and EntityMetricData properties). Although the Value parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported. You can use up to 30 dimensions per metric to further clarify what data the metric collects. Each dimension consists of a Name and Value pair. For more information about specifying dimensions, see Publishing Metrics in the Amazon CloudWatch User Guide. You specify the time stamp to be associated with each data point. You can specify time stamps that are as much as two weeks before the current date, and as much as 2 hours after the current day and time. Data points with time stamps from 24 hours ago or longer can take at least 48 hours to become available for GetMetricData or GetMetricStatistics from the time they are submitted. Data points with time stamps between 3 and 24 hours ago can take as much as 2 hours to become available for GetMetricData or GetMetricStatistics. PutMetricData API Version 2010-08-01 144 Amazon CloudWatch API Reference CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data if one of the following conditions is true: • The SampleCount value of the statistic set is 1 and Min, Max, and Sum are all equal. • The Min and Max are equal, and Sum is equal to Min multiplied by SampleCount. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. EntityMetricData.member.N Data for metrics that contain associated entity information. You can include up to two EntityMetricData objects, each of which can contain a single Entity and associated metrics. The limit of metrics allowed, 1000, is the sum of both EntityMetricData and MetricData metrics. Type: Array of EntityMetricData objects Required: No MetricData.member.N The data for the metrics. Use this parameter if your metrics do not contain associated entities. The array can include no more than 1000 metrics per call. The limit of metrics allowed, 1000, is the sum of both EntityMetricData and |
acw-api-034 | acw-api.pdf | 34 | that are common to all actions, see Common Parameters. EntityMetricData.member.N Data for metrics that contain associated entity information. You can include up to two EntityMetricData objects, each of which can contain a single Entity and associated metrics. The limit of metrics allowed, 1000, is the sum of both EntityMetricData and MetricData metrics. Type: Array of EntityMetricData objects Required: No MetricData.member.N The data for the metrics. Use this parameter if your metrics do not contain associated entities. The array can include no more than 1000 metrics per call. The limit of metrics allowed, 1000, is the sum of both EntityMetricData and MetricData metrics. Type: Array of MetricDatum objects Required: No Namespace The namespace for the metric data. You can use ASCII characters for the namespace, except for control characters which are not supported. Request Parameters API Version 2010-08-01 145 Amazon CloudWatch API Reference To avoid conflicts with AWS service namespaces, you should not specify a namespace that begins with AWS/ Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: Yes StrictEntityValidation Whether to accept valid metric data when an invalid entity is sent. • When set to true: Any validation error (for entity or metric data) will fail the entire request, and no data will be ingested. The failed operation will return a 400 result with the error. • When set to false: Validation errors in the entity will not associate the metric with the entity, but the metric data will still be accepted and ingested. Validation errors in the metric data will fail the entire request, and no data will be ingested. In the case of an invalid entity, the operation will return a 200 status, but an additional response header will contain information about the validation errors. The new header, X- Amzn-Failure-Message is an enumeration of the following values: • InvalidEntity - The provided entity is invalid. • InvalidKeyAttributes - The provided KeyAttributes of an entity is invalid. • InvalidAttributes - The provided Attributes of an entity is invalid. • InvalidTypeValue - The provided Type in the KeyAttributes of an entity is invalid. • EntitySizeTooLarge - The number of EntityMetricData objects allowed is 2. • MissingRequiredFields - There are missing required fields in the KeyAttributes for the provided Type. For details of the requirements for specifying an entity, see How to add related information to telemetry in the CloudWatch User Guide. This parameter is required when EntityMetricData is included. Type: Boolean Required: No Request Parameters API Version 2010-08-01 146 Amazon CloudWatch Errors API Reference For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 Examples Example The following example puts data for a single metric containing one dimension: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &Namespace=TestNamespace &MetricData.member.1.MetricName=buffers &MetricData.member.1.Unit=Bytes &MetricData.member.1.Value=231434333 &MetricData.member.1.Dimensions.member.1.Name=InstanceType Errors API Version 2010-08-01 147 Amazon CloudWatch API Reference &MetricData.member.1.Dimensions.member.1.Value=m1.small &AUTHPARAMS Example The following example puts data for a single metric containing two dimensions: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &Namespace=TestNamespace &MetricData.member.1.MetricName=buffers &MetricData.member.1.Unit=Bytes &MetricData.member.1.Value=231434333 &MetricData.member.1.Dimensions.member.1.Name=InstanceID &MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &MetricData.member.1.Dimensions.member.2.Name=InstanceType &MetricData.member.1.Dimensions.member.2.Value=m1.small &AUTHPARAMS Example The following example puts data for two metrics, each with two dimensions: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &Namespace=TestNamespace &MetricData.member.1.MetricName=buffers &MetricData.member.1.Unit=Bytes &MetricData.member.1.Value=231434333 &MetricData.member.1.Dimensions.member.1.Name=InstanceID &MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &MetricData.member.1.Dimensions.member.2.Name=InstanceType &MetricData.member.1.Dimensions.member.2.Value=m1.small &MetricData.member.2.MetricName=latency &MetricData.member.2.Unit=Milliseconds &MetricData.member.2.Value=23 Examples API Version 2010-08-01 148 Amazon CloudWatch API Reference &MetricData.member.2.Dimensions.member.1.Name=InstanceID &MetricData.member.2.Dimensions.member.1.Value=i-aaba32d4 &MetricData.member.2.Dimensions.member.2.Name=InstanceType &MetricData.member.2.Dimensions.member.2.Value=m1.small &AUTHPARAMS Example The following example puts data for a high-resolution metric: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &Namespace=HighResolutionMetric &MetricData.member.1.MetricName=HighResdata &MetricData.member.1.Unit=Bytes &MetricData.member.1.Value=542868 &MetricData.member.1.StorageResolution=1 &AUTHPARAMS Example The following example puts multiple values for each of two metrics, using Values and Counts arrays: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &Namespace=TestNamespace &MetricData.member.1.MetricName=Reads &MetricData.member.1.Unit=Count &MetricData.member.1.Values.member.1=5 &MetricData.member.1.Values.member.2=8 &MetricData.member.1.Values.member.3=10 &MetricData.member.1.Values.member.4=9 &MetricData.member.1.Counts.member.1=1 &MetricData.member.1.Counts.member.2=5 &MetricData.member.1.Counts.member.3=6 Examples API Version 2010-08-01 149 Amazon CloudWatch API Reference &MetricData.member.1.Counts.member.4=5 &MetricData.member.1.Dimensions.member.1.Name=InstanceID &MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &MetricData.member.2.MetricName=Writes &MetricData.member.2.Unit=Count &MetricData.member.2.Values.member.1=2 &MetricData.member.2.Values.member.2=3 &MetricData.member.2.Values.member.3=0 &MetricData.member.2.Counts.member.1=2 &MetricData.member.2.Counts.member.2=2 &MetricData.member.2.Counts.member.3=1 &MetricData.member.2.Dimensions.member.1.Name=InstanceID &MetricData.member.2.Dimensions.member.1.Value=i-aaba32d4 &AUTHPARAMS Example The following example uses EntityMetricData to put a metric with entity data for a service running in Amazon EC2: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &StrictEntityValidation=true &Namespace=TestNamespace &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.key=Type &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.value=Service &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.key=Name &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.value=MyTestService &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.key=Environment &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.value=MyTestEnvironment &EntityMetricData.member.1.Entity.Attributes.entry.1.key=PlatformType &EntityMetricData.member.1.Entity.Attributes.entry.1.value=AWS::EC2 &EntityMetricData.member.1.Entity.Attributes.entry.2.key=EC2.InstanceId &EntityMetricData.member.1.Entity.Attributes.entry.2.value=i-1234567890abcdef0 &EntityMetricData.member.1.MetricData.member.1.MetricName=buffers &EntityMetricData.member.1.MetricData.member.1.Timestamp=2024-11-06T02:16:28Z &EntityMetricData.member.1.MetricData.member.1.Unit=Count &EntityMetricData.member.1.MetricData.member.1.Values.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Values.member.2=3 &EntityMetricData.member.1.MetricData.member.1.Values.member.3=0 Examples API Version 2010-08-01 150 Amazon CloudWatch API Reference &EntityMetricData.member.1.MetricData.member.1.Counts.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.2=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.3=1 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Name=InstanceID &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Name=InstanceType &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Value=m1.small &AUTHPARAMS Example The following example uses EntityMetricData to put a metric with entity data for a service running in Lambda: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &StrictEntityValidation=true &Namespace=TestNamespace &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.key=Type &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.value=Service &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.key=Name &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.value=MyTestService &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.key=Environment &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.value=MyTestEnvironment &EntityMetricData.member.1.Entity.Attributes.entry.1.key=PlatformType &EntityMetricData.member.1.Entity.Attributes.entry.1.value=AWS::Lambda &EntityMetricData.member.1.Entity.Attributes.entry.2.key=Lambda.Function &EntityMetricData.member.1.Entity.Attributes.entry.2.value=MyTestFunction &EntityMetricData.member.1.MetricData.member.1.MetricName=faults &EntityMetricData.member.1.MetricData.member.1.Timestamp=2024-11-06T02:16:28Z &EntityMetricData.member.1.MetricData.member.1.Unit=Count &EntityMetricData.member.1.MetricData.member.1.Values.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Values.member.2=3 &EntityMetricData.member.1.MetricData.member.1.Values.member.3=0 &EntityMetricData.member.1.MetricData.member.1.Counts.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.2=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.3=1 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Name=InstanceID &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Name=InstanceType Examples API Version 2010-08-01 151 Amazon CloudWatch API Reference &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Value=m1.small &AUTHPARAMS See Also For more information about |
acw-api-035 | acw-api.pdf | 35 | &StrictEntityValidation=true &Namespace=TestNamespace &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.key=Type &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.value=Service &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.key=Name &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.value=MyTestService &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.key=Environment &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.value=MyTestEnvironment &EntityMetricData.member.1.Entity.Attributes.entry.1.key=PlatformType &EntityMetricData.member.1.Entity.Attributes.entry.1.value=AWS::EC2 &EntityMetricData.member.1.Entity.Attributes.entry.2.key=EC2.InstanceId &EntityMetricData.member.1.Entity.Attributes.entry.2.value=i-1234567890abcdef0 &EntityMetricData.member.1.MetricData.member.1.MetricName=buffers &EntityMetricData.member.1.MetricData.member.1.Timestamp=2024-11-06T02:16:28Z &EntityMetricData.member.1.MetricData.member.1.Unit=Count &EntityMetricData.member.1.MetricData.member.1.Values.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Values.member.2=3 &EntityMetricData.member.1.MetricData.member.1.Values.member.3=0 Examples API Version 2010-08-01 150 Amazon CloudWatch API Reference &EntityMetricData.member.1.MetricData.member.1.Counts.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.2=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.3=1 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Name=InstanceID &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Name=InstanceType &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Value=m1.small &AUTHPARAMS Example The following example uses EntityMetricData to put a metric with entity data for a service running in Lambda: Sample Request https://monitoring.us-west-1.amazonaws.com ?Action=PutMetricData &Version=2010-08-01 &StrictEntityValidation=true &Namespace=TestNamespace &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.key=Type &EntityMetricData.member.1.Entity.KeyAttributes.entry.1.value=Service &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.key=Name &EntityMetricData.member.1.Entity.KeyAttributes.entry.2.value=MyTestService &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.key=Environment &EntityMetricData.member.1.Entity.KeyAttributes.entry.3.value=MyTestEnvironment &EntityMetricData.member.1.Entity.Attributes.entry.1.key=PlatformType &EntityMetricData.member.1.Entity.Attributes.entry.1.value=AWS::Lambda &EntityMetricData.member.1.Entity.Attributes.entry.2.key=Lambda.Function &EntityMetricData.member.1.Entity.Attributes.entry.2.value=MyTestFunction &EntityMetricData.member.1.MetricData.member.1.MetricName=faults &EntityMetricData.member.1.MetricData.member.1.Timestamp=2024-11-06T02:16:28Z &EntityMetricData.member.1.MetricData.member.1.Unit=Count &EntityMetricData.member.1.MetricData.member.1.Values.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Values.member.2=3 &EntityMetricData.member.1.MetricData.member.1.Values.member.3=0 &EntityMetricData.member.1.MetricData.member.1.Counts.member.1=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.2=2 &EntityMetricData.member.1.MetricData.member.1.Counts.member.3=1 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Name=InstanceID &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.1.Value=i-aaba32d4 &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Name=InstanceType Examples API Version 2010-08-01 151 Amazon CloudWatch API Reference &EntityMetricData.member.1.MetricData.member.1.Dimensions.member.2.Value=m1.small &AUTHPARAMS See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 152 Amazon CloudWatch PutMetricStream API Reference Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to AWS destinations, including Amazon S3, and to many third-party solutions. For more information, see Using Metric Streams. To create a metric stream, you must be signed in to an account that has the iam:PassRole permission and either the CloudWatchFullAccess policy or the cloudwatch:PutMetricStream permission. When you create or update a metric stream, you choose one of the following: • Stream metrics from all metric namespaces in the account. • Stream metrics from all metric namespaces in the account, except for the namespaces that you list in ExcludeFilters. • Stream metrics from only the metric namespaces that you list in IncludeFilters. By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed. You can use the StatisticsConfigurations parameter to have the metric stream send additional statistics in the stream. Streaming additional statistics incurs additional costs. For more information, see Amazon CloudWatch Pricing. When you use PutMetricStream to create a new metric stream, the stream is created in the running state. If you use it to update an existing stream, the state of the stream is not changed. If you are using CloudWatch cross-account observability and you create a metric stream in a monitoring account, you can choose whether to include metrics from source accounts in the stream. For more information, see CloudWatch cross-account observability. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ExcludeFilters.member.N If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. You cannot include ExcludeFilters and IncludeFilters in the same operation. PutMetricStream API Version 2010-08-01 153 Amazon CloudWatch API Reference Type: Array of MetricStreamFilter objects Required: No FirehoseArn The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream. This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the same account as the metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes IncludeFilters.member.N If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. You cannot include IncludeFilters and ExcludeFilters in the same operation. Type: Array of MetricStreamFilter objects Required: No IncludeLinkedAccountsMetrics If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts in the metric stream. Type: Boolean Required: No Name If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region. If you are updating a metric stream, specify the name of that stream here. Valid characters are A-Z, a-z, 0-9, "-" and "_". Request Parameters API Version 2010-08-01 154 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes OutputFormat The output format for the stream. Valid values are json, opentelemetry1.0, and opentelemetry0.7. For more information about metric stream output formats, see Metric streams output formats. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Valid Values: json | opentelemetry0.7 | opentelemetry1.0 Required: Yes RoleArn The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions: • firehose:PutRecord • firehose:PutRecordBatch Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes StatisticsConfigurations.member.N By default, a metric stream always sends the MAX, MIN, SUM, |
acw-api-036 | acw-api.pdf | 36 | Metric streams output formats. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Valid Values: json | opentelemetry0.7 | opentelemetry1.0 Required: Yes RoleArn The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions: • firehose:PutRecord • firehose:PutRecordBatch Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes StatisticsConfigurations.member.N By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members. For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat. If the OutputFormat is json, you can stream any additional Request Parameters API Version 2010-08-01 155 Amazon CloudWatch API Reference statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry1.0 or opentelemetry0.7, you can stream percentile statistics such as p95, p99.9, and so on. Type: Array of MetricStreamStatisticsConfiguration objects Required: No Tags.member.N A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource. Type: Array of Tag objects Required: No Response Elements The following element is returned by the service. Arn The ARN of the metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Errors For information about the errors that are common to all actions, see Common Errors. Response Elements API Version 2010-08-01 156 Amazon CloudWatch ConcurrentModification API Reference More than one process tried to modify a resource at the same time. HTTP Status Code: 429 InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterCombination Parameters were used together that cannot be used together. HTTP Status Code: 400 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 Examples Stream two namespaces with the default statistics The following example creates a metric stream that streams all the metrics from the AWS/EC2 and AWS/ELB namespaces, with only the default statistics. Sample Request { "Name": "MyMetricStream", "FirehoseArn": "arn:aws:firehose:us-east-1:123456789098:stream/MyFirehose", "RoleArn": "arn:aws:iam::123456789098:role/MyFirehoseWriteAccessRole", Examples API Version 2010-08-01 157 Amazon CloudWatch API Reference "IncludeFilters": [ { "Namespace": "AWS/EC2" }, { "Namespace": "AWS/ELB" } ], "OutputFormat": "opentelemetry1.0" } In a monitoring account, stream two namespaces with default statistics from all source accounts The following example creates a metric stream that streams all the metrics from the AWS/EC2 and AWS/ELB namespaces from this monitoring account and from all source accounts that it is linked to. Sample Request { "Name": "MyMetricStream", "FirehoseArn": "arn:aws:firehose:us-east-1:123456789098:stream/MyFirehose", "RoleArn": "arn:aws:iam::123456789098:role/MyFirehoseWriteAccessRole", "IncludeLinkedAccountsMetrics": "true", "IncludeFilters": [ { "Namespace": "AWS/EC2" }, { "Namespace": "AWS/ELB" } ], "OutputFormat": "opentelemetry1.0" } Stream additional statistics The following example creates a metric stream that streams all metrics from the AWS/EC2 namespace with only the default statistics, and also streams two other metrics with the default statistics and some additional statistics. Examples API Version 2010-08-01 158 Amazon CloudWatch Sample Request { "Name": "MyMetricStream", "FirehoseArn": "arn:aws:firehose:us-east-1:123456789098:stream/MyFirehose", "RoleArn": "arn:aws:iam::123456789098:role/MyFirehoseWriteAccessRole", API Reference "IncludeFilters": [ { "Namespace": "AWS/EC2" } ], "OutputFormat": "json", "StatisticsConfigurations": [ { "IncludeMetrics": [ { "Namespace": "AWS/ApplicationELB", "MetricName": "TargetResponseTime" }, { "Namespace": "AWS/ELB", "MetricName": "Latency" } ], "AdditionalStatistics": [ "tm90", "p90", "p99", "p99.9" ] } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ See Also API Version 2010-08-01 159 Amazon CloudWatch • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 160 Amazon CloudWatch SetAlarmState API Reference Temporarily sets the state of an alarm for testing purposes. |
acw-api-037 | acw-api.pdf | 37 | about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ See Also API Version 2010-08-01 159 Amazon CloudWatch • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 160 Amazon CloudWatch SetAlarmState API Reference Temporarily sets the state of an alarm for testing purposes. When the updated state differs from the previous value, the action configured for the appropriate state is invoked. For example, if your alarm is configured to send an Amazon SNS message when an alarm is triggered, temporarily changing the alarm state to ALARM sends an SNS message. Metric alarms returns to their actual state quickly, often within seconds. Because the metric alarm state change happens quickly, it is typically only visible in the alarm's History tab in the Amazon CloudWatch console or through DescribeAlarmHistory. If you use SetAlarmState on a composite alarm, the composite alarm is not guaranteed to return to its actual state. It returns to its actual state only once any of its children alarms change state. It is also reevaluated if you update its configuration. If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling policies, you must include information in the StateReasonData parameter to enable the policy to take the correct action. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. AlarmName The name of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes StateReason The reason that this alarm is set to this specific state, in text format. Type: String Length Constraints: Minimum length of 0. Maximum length of 1023. Required: Yes StateReasonData The reason that this alarm is set to this specific state, in JSON format. SetAlarmState API Version 2010-08-01 161 Amazon CloudWatch API Reference For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action. Type: String Length Constraints: Minimum length of 0. Maximum length of 4000. Required: No StateValue The value of the state. Type: String Valid Values: OK | ALARM | INSUFFICIENT_DATA Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. InvalidFormat Data was not syntactically valid JSON. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 Examples Example The following example sets the alarm state to ALARM, and provides information inside of StateReasonData so that Auto Scaling actions can be performed correctly according to your Auto Scaling policies. Errors API Version 2010-08-01 162 Amazon CloudWatch API Reference { "AlarmName": "ExampleAlarmName", "StateValue": "ALARM", "StateReason": "Testing Alarm State", "StateReasonData": { "Version": "1.0", "QueryDate": "2018-10-31T14:32:52.031+0000", "StartDate": "2018-10-31T14:31:00.000+0000", "Statistic": "Average", "Period": 60, "RecentDatapoints": [ 100 ], "Threshold": 50 } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 163 Amazon CloudWatch StartMetricStreams API Reference Starts the streaming of metrics for one or more of your metric streams. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Names.member.N The array of the names of metric streams to start streaming. This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will start streaming. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 StartMetricStreams API Version 2010-08-01 164 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • |
acw-api-038 | acw-api.pdf | 38 | Yes Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 StartMetricStreams API Version 2010-08-01 164 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 165 Amazon CloudWatch StopMetricStreams API Reference Stops the streaming of metrics for one or more of your metric streams. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. Names.member.N The array of the names of metric streams to stop streaming. This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 MissingParameter An input parameter that is required is missing. HTTP Status Code: 400 StopMetricStreams API Version 2010-08-01 166 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 167 Amazon CloudWatch TagResource API Reference Assigns one or more tags (key-value pairs) to the specified CloudWatch resource. Currently, the only CloudWatch resources that can be tagged are alarms and Contributor Insights rules. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters. You can use the TagResource action with an alarm that already has tags. If you specify a new tag key for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the alarm, the new tag value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a CloudWatch resource. Request Parameters For information about the parameters that are common to all actions, see Common Parameters. ResourceARN The ARN of the CloudWatch resource that you're adding tags to. The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm- name The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account- id:insight-rule/insight-rule-name For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes TagResource API Version 2010-08-01 168 Amazon CloudWatch Tags.member.N The list of key-value pairs to associate with the alarm. API Reference Type: Array of Tag objects Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. ConcurrentModification More than one process tried to modify a resource at the same time. HTTP Status Code: 429 InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET Errors API Version 2010-08-01 169 API Reference Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript |
acw-api-039 | acw-api.pdf | 39 | has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET Errors API Version 2010-08-01 169 API Reference Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 170 Amazon CloudWatch UntagResource Removes one or more tags from the specified resource. Request Parameters API Reference For information about the parameters that are common to all actions, see Common Parameters. ResourceARN The ARN of the CloudWatch resource that you're removing tags from. The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm- name The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account- id:insight-rule/insight-rule-name For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes TagKeys.member.N The list of tag keys to remove from the resource. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 128. Required: Yes Errors For information about the errors that are common to all actions, see Common Errors. UntagResource API Version 2010-08-01 171 Amazon CloudWatch ConcurrentModification API Reference More than one process tried to modify a resource at the same time. HTTP Status Code: 429 InternalServiceError Request processing has failed due to some unknown error, exception, or failure. HTTP Status Code: 500 InvalidParameterValue The value of an input parameter is bad or out-of-range. HTTP Status Code: 400 ResourceNotFound The named resource does not exist. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also API Version 2010-08-01 172 Amazon CloudWatch Data Types API Reference The Amazon CloudWatch API contains several data types that various actions use. This section describes each data type in detail. Note The order of each element in a data type structure is not guaranteed. Applications should not assume a particular order. The following data types are supported: • AlarmHistoryItem • AnomalyDetector • AnomalyDetectorConfiguration • CompositeAlarm • DashboardEntry • DashboardValidationMessage • Datapoint • Dimension • DimensionFilter • Entity • EntityMetricData • InsightRule • InsightRuleContributor • InsightRuleContributorDatapoint • InsightRuleMetricDatapoint • LabelOptions • ManagedRule • ManagedRuleDescription • ManagedRuleState • MessageData API Version 2010-08-01 173 Amazon CloudWatch • Metric • MetricAlarm • MetricCharacteristics • MetricDataQuery • MetricDataResult • MetricDatum • MetricMathAnomalyDetector • MetricStat • MetricStreamEntry • MetricStreamFilter • MetricStreamStatisticsConfiguration • MetricStreamStatisticsMetric • PartialFailure • Range • SingleMetricAnomalyDetector • StatisticSet • Tag API Reference API Version 2010-08-01 174 API Reference Amazon CloudWatch AlarmHistoryItem Represents the history of a specific alarm. Contents AlarmName The descriptive name for the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No AlarmType The type of alarm, either metric alarm or composite alarm. Type: String Valid Values: CompositeAlarm | MetricAlarm Required: No HistoryData Data about the alarm, in JSON format. Type: String Length Constraints: Minimum length of 1. Maximum length of 4095. Required: No HistoryItemType The type of alarm history item. Type: String Valid Values: ConfigurationUpdate | StateUpdate | Action Required: No AlarmHistoryItem API Version 2010-08-01 175 Amazon CloudWatch HistorySummary API Reference A summary of the alarm history, in text format. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Timestamp The time stamp for the alarm history item. Type: Timestamp Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 176 Amazon CloudWatch AnomalyDetector API Reference An anomaly detection model associated with a particular CloudWatch metric, statistic, or metric math expression. You can use the model to display a band of expected, normal values when the metric is graphed. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a |
acw-api-040 | acw-api.pdf | 40 | information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 176 Amazon CloudWatch AnomalyDetector API Reference An anomaly detection model associated with a particular CloudWatch metric, statistic, or metric math expression. You can use the model to display a band of expected, normal values when the metric is graphed. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account. Contents Configuration The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric. Type: AnomalyDetectorConfiguration object Required: No Dimensions.member.N This member has been deprecated. The metric dimensions associated with the anomaly detection model. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MetricCharacteristics This object includes parameters that you can use to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the PeriodicSpikes parameter. Type: MetricCharacteristics object Required: No AnomalyDetector API Version 2010-08-01 177 Amazon CloudWatch MetricMathAnomalyDetector API Reference The CloudWatch metric math expression for this anomaly detector. Type: MetricMathAnomalyDetector object Required: No MetricName This member has been deprecated. The name of the metric associated with the anomaly detection model. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace This member has been deprecated. The namespace of the metric associated with the anomaly detection model. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No SingleMetricAnomalyDetector The CloudWatch metric and statistic for this anomaly detector. Type: SingleMetricAnomalyDetector object Required: No Stat This member has been deprecated. The statistic associated with the anomaly detection model. Contents API Version 2010-08-01 178 Amazon CloudWatch Type: String Length Constraints: Maximum length of 50. API Reference Pattern: (SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm) (\d{1,2}(\.\d{0,10})?|100)|[ou]\d+(\.\d*)?)(_E|_L|_H)?|(TM|TC|TS| WM)\(((((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?:((\d{1,2})(\. \d{0,10})?|100(\.0{0,10})?)%|((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%: (((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?)\)|(TM|TC|TS|WM|PR)\(((\d +(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)):((\d+(\.\d{0,10})?|(\d +(\.\d{0,10})?[Ee][+-]?\d+)))?|((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee] [+-]?\d+)))?:(\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))\) Required: No StateValue The current status of the anomaly detector's training. Type: String Valid Values: PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA | TRAINED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 179 Amazon CloudWatch API Reference AnomalyDetectorConfiguration The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model and the time zone to use for the metric. Contents ExcludedTimeRanges.member.N An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model. Type: Array of Range objects Required: No MetricTimezone The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes. To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see tz database. Type: String Length Constraints: Maximum length of 50. Pattern: .* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 AnomalyDetectorConfiguration API Version 2010-08-01 180 Amazon CloudWatch • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 181 Amazon CloudWatch CompositeAlarm The details about a composite alarm. Contents ActionsEnabled API Reference Indicates whether actions should be executed during any changes to the alarm state. Type: Boolean Required: No ActionsSuppressedBy When the value is ALARM, it means that the actions are suppressed because the suppressor alarm is in ALARM When the value is WaitPeriod, it means that the actions are suppressed because the composite alarm is waiting for the suppressor alarm to go into into the ALARM state. The maximum waiting time is as specified in ActionsSuppressorWaitPeriod. After this time, the composite alarm performs its actions. When the value is ExtensionPeriod, it means that the actions are suppressed because the composite alarm is waiting after the suppressor alarm went out of the ALARM state. The maximum waiting time is as specified in ActionsSuppressorExtensionPeriod. After this time, the composite alarm performs its actions. Type: String Valid Values: WaitPeriod | ExtensionPeriod | Alarm Required: No ActionsSuppressedReason Captures the reason for action suppression. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Required: |
acw-api-041 | acw-api.pdf | 41 | into into the ALARM state. The maximum waiting time is as specified in ActionsSuppressorWaitPeriod. After this time, the composite alarm performs its actions. When the value is ExtensionPeriod, it means that the actions are suppressed because the composite alarm is waiting after the suppressor alarm went out of the ALARM state. The maximum waiting time is as specified in ActionsSuppressorExtensionPeriod. After this time, the composite alarm performs its actions. Type: String Valid Values: WaitPeriod | ExtensionPeriod | Alarm Required: No ActionsSuppressedReason Captures the reason for action suppression. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No CompositeAlarm API Version 2010-08-01 182 Amazon CloudWatch ActionsSuppressor API Reference Actions will be suppressed if the suppressor alarm is in the ALARM state. ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 1600. Required: No ActionsSuppressorExtensionPeriod The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the ALARM state. After this time, the composite alarm performs its actions. Important ExtensionPeriod is required only when ActionsSuppressor is specified. Type: Integer Required: No ActionsSuppressorWaitPeriod The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the ALARM state. After this time, the composite alarm performs its actions. Important WaitPeriod is required only when ActionsSuppressor is specified. Type: Integer Required: No AlarmActions.member.N The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Contents API Version 2010-08-01 183 Amazon CloudWatch Type: Array of strings API Reference Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmArn The Amazon Resource Name (ARN) of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 1600. Required: No AlarmConfigurationUpdatedTimestamp The time stamp of the last update to the alarm configuration. Type: Timestamp Required: No AlarmDescription The description of the alarm. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No AlarmName The name of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Contents API Version 2010-08-01 184 Amazon CloudWatch AlarmRule API Reference The rule that this alarm uses to evaluate its alarm state. Type: String Length Constraints: Minimum length of 1. Maximum length of 10240. Required: No InsufficientDataActions.member.N The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No OKActions.member.N The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No StateReason An explanation for the alarm state, in text format. Type: String Length Constraints: Minimum length of 0. Maximum length of 1023. Required: No Contents API Version 2010-08-01 185 Amazon CloudWatch StateReasonData API Reference An explanation for the alarm state, in JSON format. Type: String Length Constraints: Minimum length of 0. Maximum length of 4000. Required: No StateTransitionedTimestamp The timestamp of the last change to the alarm's StateValue. Type: Timestamp Required: No StateUpdatedTimestamp Tracks the timestamp of any state update, even if StateValue doesn't change. Type: Timestamp Required: No StateValue The state value for the alarm. Type: String Valid Values: OK | ALARM | INSUFFICIENT_DATA Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 186 Amazon CloudWatch API Reference See Also API Version 2010-08-01 187 API Reference Amazon CloudWatch DashboardEntry Represents a specific dashboard. Contents DashboardArn The Amazon Resource Name (ARN) of the dashboard. Type: String Required: No DashboardName The name of the dashboard. Type: String Required: No LastModified The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. Type: Timestamp Required: No Size The size of the dashboard, in bytes. Type: Long Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: DashboardEntry API Version 2010-08-01 188 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See |
acw-api-042 | acw-api.pdf | 42 | String Required: No LastModified The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. Type: Timestamp Required: No Size The size of the dashboard, in bytes. Type: Long Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: DashboardEntry API Version 2010-08-01 188 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 189 Amazon CloudWatch API Reference DashboardValidationMessage An error or warning for the operation. Contents DataPath The data path related to the message. Type: String Required: No Message A message describing the error or warning. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 DashboardValidationMessage API Version 2010-08-01 190 Amazon CloudWatch Datapoint API Reference Encapsulates the statistical data that CloudWatch computes from metric data. Contents Average The average of the metric values that correspond to the data point. Type: Double Required: No ExtendedStatistics , ExtendedStatistics.entry.N.key (key) , ExtendedStatistics.entry.N.value (value) The percentile statistic for the data point. Type: String to double map Required: No Maximum The maximum metric value for the data point. Type: Double Required: No Minimum The minimum metric value for the data point. Type: Double Required: No SampleCount The number of metric values that contributed to the aggregate value of this data point. Type: Double Required: No Datapoint API Version 2010-08-01 191 API Reference Amazon CloudWatch Sum The sum of the metric values for the data point. Type: Double Required: No Timestamp The time stamp used for the data point. Type: Timestamp Required: No Unit The standard unit for the data point. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 192 Amazon CloudWatch Dimension API Reference A dimension is a name/value pair that is part of the identity of a metric. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish InstanceId as a dimension name, and the actual instance ID as the value for that dimension. You can assign up to 30 dimensions to a metric. Contents Name The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:). ASCII control characters are not supported as part of dimension names. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Value The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: Dimension API Version 2010-08-01 193 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 194 API Reference Amazon CloudWatch DimensionFilter Represents filters for a dimension. Contents Name The dimension name to be matched. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Value The value of the dimension to be matched. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 DimensionFilter API Version 2010-08-01 195 Amazon CloudWatch Entity API Reference An entity associated with metrics, to allow for finding related telemetry. An entity is typically a resource or service within your system. For example, metrics from an Amazon EC2 instance could be associated with that |
acw-api-043 | acw-api.pdf | 43 | the dimension to be matched. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 DimensionFilter API Version 2010-08-01 195 Amazon CloudWatch Entity API Reference An entity associated with metrics, to allow for finding related telemetry. An entity is typically a resource or service within your system. For example, metrics from an Amazon EC2 instance could be associated with that instance as the entity. Similarly, metrics from a service that you own could be associated with that service as the entity. Contents Attributes , Attributes.entry.N.key (key) , Attributes.entry.N.value (value) Additional attributes of the entity that are not used to specify the identity of the entity. A list of key-value pairs. For details about how to use the attributes, see How to add related information to telemetry in the CloudWatch User Guide. Type: String to string map Map Entries: Minimum number of 0 items. Maximum number of 10 items. Key Length Constraints: Minimum length of 1. Maximum length of 256. Value Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No KeyAttributes , KeyAttributes.entry.N.key (key) , KeyAttributes.entry.N.value (value) The attributes of the entity which identify the specific entity, as a list of key-value pairs. Entities with the same KeyAttributes are considered to be the same entity. For an entity to be valid, the KeyAttributes must exist and be formatted correctly. There are five allowed attributes (key names): Type, ResourceType, Identifier, Name, and Environment. For details about how to use the key attributes to specify an entity, see How to add related information to telemetry in the CloudWatch User Guide. Type: String to string map Map Entries: Minimum number of 2 items. Maximum number of 4 items. Entity API Version 2010-08-01 196 Amazon CloudWatch API Reference Key Length Constraints: Minimum length of 1. Maximum length of 32. Value Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 197 Amazon CloudWatch EntityMetricData API Reference A set of metrics that are associated with an entity, such as a specific service or resource. Contains the entity and the list of metric data associated with it. Contents Entity The entity associated with the metrics. Type: Entity object Required: No MetricData.member.N The metric data. Type: Array of MetricDatum objects Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 EntityMetricData API Version 2010-08-01 198 Amazon CloudWatch InsightRule API Reference This structure contains the definition for a Contributor Insights rule. For more information about this rule, see Using Constributor Insights to analyze high-cardinality data in the Amazon CloudWatch User Guide. Contents Definition The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see Contributor Insights Rule Syntax. Type: String Length Constraints: Minimum length of 1. Maximum length of 8192. Pattern: [\x00-\x7F]+ Required: Yes Name The name of the rule. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes Schema For rules that you create, this is always {"Name": "CloudWatchLogRule", "Version": 1}. For managed rules, this is {"Name": "ServiceLogRule", "Version": 1} Type: String Required: Yes InsightRule API Version 2010-08-01 199 Amazon CloudWatch State API Reference Indicates whether the rule is enabled or disabled. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: Yes ManagedRule An optional built-in rule that AWS manages. Type: Boolean Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 200 Amazon CloudWatch API Reference InsightRuleContributor One of the unique contributors found by a Contributor Insights rule. If the rule contains multiple keys, then a unique contributor is a unique combination of values from all the keys in the rule. If the rule contains a single key, then each unique contributor is each unique value for this key. For more information, see GetInsightRuleReport. Contents ApproximateAggregateValue An approximation of the aggregate value that comes from |
acw-api-044 | acw-api.pdf | 44 | SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 200 Amazon CloudWatch API Reference InsightRuleContributor One of the unique contributors found by a Contributor Insights rule. If the rule contains multiple keys, then a unique contributor is a unique combination of values from all the keys in the rule. If the rule contains a single key, then each unique contributor is each unique value for this key. For more information, see GetInsightRuleReport. Contents ApproximateAggregateValue An approximation of the aggregate value that comes from this contributor. Type: Double Required: Yes Datapoints.member.N An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array. Type: Array of InsightRuleContributorDatapoint objects Required: Yes Keys.member.N One of the log entry field keywords that is used to define contributors for this rule. Type: Array of strings Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ InsightRuleContributor API Version 2010-08-01 201 Amazon CloudWatch • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 202 Amazon CloudWatch API Reference InsightRuleContributorDatapoint One data point related to one contributor. For more information, see GetInsightRuleReport and InsightRuleContributor. Contents ApproximateValue The approximate value that this contributor added during this timestamp. Type: Double Required: Yes Timestamp The timestamp of the data point. Type: Timestamp Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 InsightRuleContributorDatapoint API Version 2010-08-01 203 Amazon CloudWatch API Reference InsightRuleMetricDatapoint One data point from the metric time series returned in a Contributor Insights rule report. For more information, see GetInsightRuleReport. Contents Timestamp The timestamp of the data point. Type: Timestamp Required: Yes Average The average value from all contributors during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No MaxContributorValue The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately, so the identity of the max contributor could be different for each timestamp. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No Maximum The maximum value from a single occurence from a single contributor during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request. InsightRuleMetricDatapoint API Version 2010-08-01 204 Amazon CloudWatch Type: Double Required: No Minimum API Reference The minimum value from a single contributor during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No SampleCount The number of occurrences that matched the rule during this data point. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No Sum The sum of the values from all contributors during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No UniqueContributors The number of unique contributors who published data during this timestamp. This statistic is returned only if you included it in the Metrics array in your request. Type: Double Required: No Contents API Version 2010-08-01 205 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 206 Amazon CloudWatch LabelOptions API Reference This structure includes the Timezone parameter, which you can use to specify your time zone so that the labels that are associated with returned metrics display the correct time for your time zone. The Timezone value affects a label only if you have a time-based dynamic expression in the label. For more information about dynamic expressions in labels, see Using Dynamic Labels. Contents Timezone The time zone to use for metric data return in this operation. The format is + or - followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. Type: String |
acw-api-045 | acw-api.pdf | 45 | The Timezone value affects a label only if you have a time-based dynamic expression in the label. For more information about dynamic expressions in labels, see Using Dynamic Labels. Contents Timezone The time zone to use for metric data return in this operation. The format is + or - followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 LabelOptions API Version 2010-08-01 207 Amazon CloudWatch ManagedRule API Reference Contains the information that's required to enable a managed Contributor Insights rule for an AWS resource. Contents ResourceARN The ARN of an AWS resource that has managed Contributor Insights rules. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: Yes TemplateName The template name for the managed Contributor Insights rule, as returned by ListManagedInsightRules. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [0-9A-Za-z][\-\.\_0-9A-Za-z]{0,126}[0-9A-Za-z] Required: Yes Tags.member.N A list of key-value pairs that you can associate with a managed Contributor Insights rule. You can associate as many as 50 tags with a rule. Tags can help you organize and categorize your resources. You also can use them to scope user permissions by granting a user permission to access or change only the resources that have certain tag values. To associate tags with a rule, you must have the cloudwatch:TagResource permission in addition to the cloudwatch:PutInsightRule permission. If you are using this operation to update an existing Contributor Insights rule, any tags that you specify in this parameter are ignored. To change the tags of an existing rule, use TagResource. Type: Array of Tag objects ManagedRule API Version 2010-08-01 208 Amazon CloudWatch Required: No See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 209 Amazon CloudWatch API Reference ManagedRuleDescription Contains information about managed Contributor Insights rules, as returned by ListManagedInsightRules. Contents ResourceARN If a managed rule is enabled, this is the ARN for the related AWS resource. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No RuleState Describes the state of a managed rule. If present, it contains information about the Contributor Insights rule that contains information about the related AWS resource. Type: ManagedRuleState object Required: No TemplateName The template name for the managed rule. Used to enable managed rules using PutManagedInsightRules. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [0-9A-Za-z][\-\.\_0-9A-Za-z]{0,126}[0-9A-Za-z] Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: ManagedRuleDescription API Version 2010-08-01 210 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 211 Amazon CloudWatch ManagedRuleState The status of a managed Contributor Insights rule. Contents RuleName API Reference The name of the Contributor Insights rule that contains data for the specified AWS resource. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\x20-\x7E]+ Required: Yes State Indicates whether the rule is enabled or disabled. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [\x20-\x7E]+ Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ManagedRuleState API Version 2010-08-01 212 Amazon CloudWatch MessageData API Reference A message returned by the GetMetricDataAPI, including a code and a description. If a cross-Region GetMetricData operation fails with a code of Forbidden and a value of Authentication too complex to retrieve cross region data, you can correct the problem by running the GetMetricData operation in the same Region where the metric data is. Contents Code The error code or status code associated with the message. Type: String Required: No Value The message text. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 MessageData API Version 2010-08-01 213 API Reference Amazon CloudWatch Metric Represents a specific metric. Contents Dimensions.member.N |
acw-api-046 | acw-api.pdf | 46 | to retrieve cross region data, you can correct the problem by running the GetMetricData operation in the same Region where the metric data is. Contents Code The error code or status code associated with the message. Type: String Required: No Value The message text. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 MessageData API Version 2010-08-01 213 API Reference Amazon CloudWatch Metric Represents a specific metric. Contents Dimensions.member.N The dimensions for the metric. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MetricName The name of the metric. This is a required field. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace The namespace of the metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: Metric API Version 2010-08-01 214 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 215 Amazon CloudWatch MetricAlarm The details about a metric alarm. Contents ActionsEnabled API Reference Indicates whether actions should be executed during any changes to the alarm state. Type: Boolean Required: No AlarmActions.member.N The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No AlarmArn The Amazon Resource Name (ARN) of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 1600. Required: No AlarmConfigurationUpdatedTimestamp The time stamp of the last update to the alarm configuration. Type: Timestamp Required: No MetricAlarm API Version 2010-08-01 216 Amazon CloudWatch AlarmDescription The description of the alarm. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. API Reference Required: No AlarmName The name of the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No ComparisonOperator The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand. Type: String Valid Values: GreaterThanOrEqualToThreshold | GreaterThanThreshold | LessThanThreshold | LessThanOrEqualToThreshold | LessThanLowerOrGreaterThanUpperThreshold | LessThanLowerThreshold | GreaterThanUpperThreshold Required: No DatapointsToAlarm The number of data points that must be breaching to trigger the alarm. Type: Integer Valid Range: Minimum value of 1. Required: No Dimensions.member.N The dimensions for the metric associated with the alarm. Contents API Version 2010-08-01 217 Amazon CloudWatch API Reference Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No EvaluateLowSampleCountPercentile Used only for alarms based on percentiles. If ignore, the alarm state does not change during periods with too few data points to be statistically significant. If evaluate or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No EvaluationPeriods The number of periods over which data is compared to the specified threshold. Type: Integer Valid Range: Minimum value of 1. Required: No EvaluationState If the value of this field is PARTIAL_DATA, the alarm is being evaluated based on only partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create alarms on Metrics Insights queries. Type: String Valid Values: PARTIAL_DATA Required: No ExtendedStatistic The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100. Contents API Version 2010-08-01 218 Amazon CloudWatch Type: String Required: No InsufficientDataActions.member.N API Reference The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No MetricName The name of the metric associated with the alarm, if this is an alarm based on a single metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Metrics.member.N An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having ReturnData set to true. Type: Array of MetricDataQuery objects Required: No Namespace The namespace |
acw-api-047 | acw-api.pdf | 47 | length of 1024. Required: No MetricName The name of the metric associated with the alarm, if this is an alarm based on a single metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Metrics.member.N An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having ReturnData set to true. Type: Array of MetricDataQuery objects Required: No Namespace The namespace of the metric associated with the alarm. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Contents API Version 2010-08-01 219 Amazon CloudWatch Required: No OKActions.member.N API Reference The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: Array of strings Array Members: Maximum number of 5 items. Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No Period The period, in seconds, over which the statistic is applied. Type: Integer Valid Range: Minimum value of 1. Required: No StateReason An explanation for the alarm state, in text format. Type: String Length Constraints: Minimum length of 0. Maximum length of 1023. Required: No StateReasonData An explanation for the alarm state, in JSON format. Type: String Length Constraints: Minimum length of 0. Maximum length of 4000. Required: No StateTransitionedTimestamp The date and time that the alarm's StateValue most recently changed. Contents API Version 2010-08-01 220 Amazon CloudWatch Type: Timestamp Required: No StateUpdatedTimestamp The time stamp of the last update to the value of either the StateValue or EvaluationState parameters. API Reference Type: Timestamp Required: No StateValue The state value for the alarm. Type: String Valid Values: OK | ALARM | INSUFFICIENT_DATA Required: No Statistic The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use ExtendedStatistic. Type: String Valid Values: SampleCount | Average | Sum | Minimum | Maximum Required: No Threshold The value to compare with the specified statistic. Type: Double Required: No ThresholdMetricId In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND function used as the threshold for the alarm. Contents API Version 2010-08-01 221 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Required: No TreatMissingData Sets how this alarm is to handle missing data points. The valid values are breaching, notBreaching, ignore, and missing. For more information, see Configuring how CloudWatch alarms treat missing data. If this parameter is omitted, the default behavior of missing is used. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Unit The unit of the metric associated with the alarm. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 See Also API Version 2010-08-01 222 Amazon CloudWatch • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 223 Amazon CloudWatch API Reference MetricCharacteristics This object includes parameters that you can use to provide information to CloudWatch to help it build more accurate anomaly detection models. Contents PeriodicSpikes Set this parameter to true if values for this metric consistently include spikes that should not be considered to be anomalies. With this set to true, CloudWatch will expect to see spikes that occurred consistently during the model training period, and won't flag future similar spikes as anomalies. Type: Boolean Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 MetricCharacteristics API Version 2010-08-01 224 Amazon CloudWatch MetricDataQuery API Reference This structure is used in both GetMetricData and PutMetricAlarm. The supported use of this structure is different for those two operations. When used in GetMetricData, it indicates the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a Metrics Insights query or a math expression. A single GetMetricData call can include up to 500 MetricDataQuery structures. When used in PutMetricAlarm, it enables you to create an alarm based on a metric math |
acw-api-048 | acw-api.pdf | 48 | AWS SDK for Ruby V3 MetricCharacteristics API Version 2010-08-01 224 Amazon CloudWatch MetricDataQuery API Reference This structure is used in both GetMetricData and PutMetricAlarm. The supported use of this structure is different for those two operations. When used in GetMetricData, it indicates the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a Metrics Insights query or a math expression. A single GetMetricData call can include up to 500 MetricDataQuery structures. When used in PutMetricAlarm, it enables you to create an alarm based on a metric math expression. Each MetricDataQuery in the array specifies either a metric to retrieve, or a math expression to be performed on retrieved metrics. A single PutMetricAlarm call can include up to 20 MetricDataQuery structures in the array. The 20 structures can include as many as 10 structures that contain a MetricStat parameter to retrieve a metric, and as many as 10 structures that contain the Expression parameter to perform a math expression. Of those Expression structures, one must have true as the value for ReturnData. The result of this expression is the value the alarm watches. Any expression used in a PutMetricAlarm operation must return a single time series. For more information, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide. Some of the parameters of this structure also have different uses whether you are using this structure in a GetMetricData operation or a PutMetricAlarm operation. These differences are explained in the following parameter list. Contents Id A short name used to tie this object to the results in the response. This name must be unique within a single call to GetMetricData. 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes MetricDataQuery API Version 2010-08-01 225 Amazon CloudWatch AccountId API Reference The ID of the account where the metrics are located. If you are performing a GetMetricData operation in a monitoring account, use this to specify which account to retrieve this metric from. If you are performing a PutMetricAlarm operation, use this to specify which account contains the metric that the alarm is watching. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Expression This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see Metrics Insights query components and syntax in the Amazon CloudWatch User Guide. A math expression can use the Id of the other metrics or queries 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. Within each MetricDataQuery object, you must specify either Expression or MetricStat but not both. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No Label 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. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default. Contents API Version 2010-08-01 226 Amazon CloudWatch API Reference You can put dynamic expressions into a label, so that it is more descriptive. For more information, see Using Dynamic Labels. Type: String Required: No MetricStat 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. Within one MetricDataQuery object, you must specify either Expression or MetricStat but not both. Type: MetricStat object Required: No Period The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high- resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData operation that includes a StorageResolution of 1 second. Type: Integer Valid Range: Minimum value of 1. Required: No ReturnData When used in GetMetricData, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need |
acw-api-049 | acw-api.pdf | 49 | seconds) and must be a multiple of 60. For high- resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData operation that includes a StorageResolution of 1 second. Type: Integer Valid Range: Minimum value of 1. Required: No ReturnData When used in GetMetricData, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify false. If you omit this, the default of true is used. When used in PutMetricAlarm, specify true for the one expression result to use as the alarm. For all other metrics and expressions in the same PutMetricAlarm operation, specify ReturnData as False. Contents API Version 2010-08-01 227 Amazon CloudWatch Type: Boolean Required: No See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 228 Amazon CloudWatch MetricDataResult API Reference A GetMetricData call returns an array of MetricDataResult structures. Each of these structures includes the data points for that metric, along with the timestamps of those data points and other identifying information. Contents Id The short name you specified to represent this metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Label The human-readable label associated with the data. Type: String Required: No Messages.member.N A list of messages with additional information about the data returned. Type: Array of MessageData objects Required: No StatusCode The status of the returned data. Complete indicates that all data points in the requested time range were returned. PartialData means that an incomplete set of data points were returned. You can use the NextToken value that was returned and repeat your request to get more data points. NextToken is not returned if you are performing a math expression. InternalError indicates that an error occurred. Retry your request using NextToken, if present. Type: String MetricDataResult API Version 2010-08-01 229 Amazon CloudWatch API Reference Valid Values: Complete | InternalError | PartialData | Forbidden Required: No Timestamps.member.N The timestamps for the data points, formatted in Unix timestamp format. The number of timestamps always matches the number of values and the value for Timestamps[x] is Values[x]. Type: Array of timestamps Required: No Values.member.N The data points for the metric corresponding to Timestamps. The number of values always matches the number of timestamps and the timestamp for Values[x] is Timestamps[x]. Type: Array of doubles Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 230 Amazon CloudWatch MetricDatum API Reference Encapsulates the information sent to either create a metric or add new values to be aggregated into an existing metric. Contents MetricName The name of the metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Counts.member.N Array of numbers that is used along with the Values array. Each number in the Count array is the number of times the corresponding value in the Values array occurred during the period. If you omit the Counts array, the default of 1 is used as the value for each count. If you include a Counts array, it must include the same amount of values as the Values array. Type: Array of doubles Required: No Dimensions.member.N The dimensions associated with the metric. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No StatisticValues The statistical values for the metric. Type: StatisticSet object MetricDatum API Version 2010-08-01 231 Amazon CloudWatch Required: No StorageResolution API Reference Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with sub-minute resolution down to one second. Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see High-Resolution Metrics in the Amazon CloudWatch User Guide. This field is optional, if you do not specify it the default of 60 is used. Type: Integer Valid Range: Minimum value of 1. Required: No Timestamp The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. Type: Timestamp Required: No Unit When you are using a Put operation, this defines what unit |
acw-api-050 | acw-api.pdf | 50 | 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see High-Resolution Metrics in the Amazon CloudWatch User Guide. This field is optional, if you do not specify it the default of 60 is used. Type: Integer Valid Range: Minimum value of 1. Required: No Timestamp The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. Type: Timestamp Required: No Unit When you are using a Put operation, this defines what unit you want to use when storing the metric. In a Get operation, this displays the unit that is used for the metric. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Contents API Version 2010-08-01 232 Amazon CloudWatch Required: No Value The value for the metric. API Reference Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported. Type: Double Required: No Values.member.N Array of numbers representing the values for the metric during the period. Each unique value is listed just once in this array, and the corresponding number in the Counts array specifies the number of times that value occurred during the period. You can include up to 150 unique values in each PutMetricData action that specifies a Values array. Although the Values array accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported. Type: Array of doubles Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 233 Amazon CloudWatch API Reference MetricMathAnomalyDetector Indicates the CloudWatch math expression that provides the time series the anomaly detector uses as input. The designated math expression must return a single time series. Contents MetricDataQueries.member.N An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in MetricDataQueries gets a metric or performs a math expression. One item in MetricDataQueries is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting ReturnData to true for this object in the array. For all other expressions and metrics, set ReturnData to false. The designated expression must return a single time series. Type: Array of MetricDataQuery objects Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 MetricMathAnomalyDetector API Version 2010-08-01 234 Amazon CloudWatch MetricStat API Reference This structure defines the metric to be returned, along with the statistics, period, and units. Contents Metric The metric to return, including the metric name, namespace, and dimensions. Type: Metric object Required: Yes Period The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high- resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second. If the StartTime parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned: • Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). • Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes). • Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour). Type: Integer Valid Range: Minimum value of 1. Required: Yes Stat The statistic to return. It can include any CloudWatch statistic or extended statistic. Type: String Required: Yes MetricStat API Version 2010-08-01 235 Amazon CloudWatch Unit API Reference |
acw-api-051 | acw-api.pdf | 51 | data points in that time range is returned: • Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). • Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes). • Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour). Type: Integer Valid Range: Minimum value of 1. Required: Yes Stat The statistic to return. It can include any CloudWatch statistic or extended statistic. Type: String Required: Yes MetricStat API Version 2010-08-01 235 Amazon CloudWatch Unit API Reference When you are using a Put operation, this defines what unit you want to use when storing the metric. In a Get operation, if you omit Unit then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions. Type: String Valid Values: Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 236 Amazon CloudWatch MetricStreamEntry API Reference This structure contains the configuration information about one metric stream. Contents Arn The ARN of the metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No CreationDate The date that the metric stream was originally created. Type: Timestamp Required: No FirehoseArn The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No LastUpdateDate The date that the configuration of this metric stream was most recently updated. Type: Timestamp Required: No Name The name of the metric stream. MetricStreamEntry API Version 2010-08-01 237 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Required: No OutputFormat The output format of this metric stream. Valid values are json, opentelemetry1.0, and opentelemetry0.7. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Valid Values: json | opentelemetry0.7 | opentelemetry1.0 Required: No State The current state of this stream. Valid values are running and stopped. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 238 Amazon CloudWatch MetricStreamFilter API Reference This structure contains a metric namespace and optionally, a list of metric names, to either include in a metric stream or exclude from a metric stream. A metric stream's filters can include up to 1000 total names. This limit applies to the sum of namespace names and metric names in the filters. For example, this could include 10 metric namespace filters with 99 metrics each, or 20 namespace filters with 49 metrics specified in each filter. Contents MetricNames.member.N The names of the metrics to either include or exclude from the metric stream. If you omit this parameter, all metrics in the namespace are included or excluded, depending on whether this filter is specified as an exclude filter or an include filter. Each metric name can contain only ASCII printable characters (ASCII range 32 through 126). Each metric name must contain at least one non-whitespace character. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace The name of the metric namespace for this filter. The namespace can contain only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No MetricStreamFilter API Version 2010-08-01 239 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 240 Amazon CloudWatch API Reference MetricStreamStatisticsConfiguration By default, a metric stream always sends the MAX, MIN, SUM, |
acw-api-052 | acw-api.pdf | 52 | only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No MetricStreamFilter API Version 2010-08-01 239 Amazon CloudWatch See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 240 Amazon CloudWatch API Reference MetricStreamStatisticsConfiguration By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed. This structure contains information for one metric that includes additional statistics in the stream. For more information about statistics, see CloudWatch, listed in CloudWatch statistics definitions. Contents AdditionalStatistics.member.N The list of additional statistics that are to be streamed for the metrics listed in the IncludeMetrics array in this structure. This list can include as many as 20 statistics. If the OutputFormat for the stream is opentelemetry1.0 or opentelemetry0.7, the only valid values are p?? percentile statistics such as p90, p99 and so on. If the OutputFormat for the stream is json, the valid values include the abbreviations for all of the statistics listed in CloudWatch statistics definitions. For example, this includes tm98, wm90, PR(:300), and so on. Type: Array of strings Required: Yes IncludeMetrics.member.N An array of metric name and namespace pairs that stream the additional statistics listed in the value of the AdditionalStatistics parameter. There can be as many as 100 pairs in the array. All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions. Type: Array of MetricStreamStatisticsMetric objects Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: MetricStreamStatisticsConfiguration API Version 2010-08-01 241 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 242 Amazon CloudWatch API Reference MetricStreamStatisticsMetric This object contains the information for one metric that is to be streamed with additional statistics. Contents MetricName The name of the metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: Yes Namespace The namespace of the metric. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 MetricStreamStatisticsMetric API Version 2010-08-01 243 Amazon CloudWatch PartialFailure API Reference This array is empty if the API operation was successful for all the rules specified in the request. If the operation could not process one of the rules, the following data is returned for each of those rules. Contents ExceptionType The type of error. Type: String Required: No FailureCode The code of the error. Type: String Required: No FailureDescription A description of the error. Type: String Required: No FailureResource The specified rule that could not be deleted. Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: PartialFailure API Version 2010-08-01 244 Amazon CloudWatch • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 245 Amazon CloudWatch Range API Reference Specifies one range of days or times to exclude from use for training an anomaly detection model. Contents EndTime The end time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. Type: Timestamp Required: Yes StartTime The start time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. Type: Timestamp Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Range API Version 2010-08-01 246 Amazon CloudWatch API Reference SingleMetricAnomalyDetector Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account. Contents AccountId If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here. If you omit this parameter, the current account is used. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Dimensions.member.N The metric dimensions to create the anomaly detection model |
acw-api-053 | acw-api.pdf | 53 | and statistic that provides the time series the anomaly detector uses as input. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account. Contents AccountId If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here. If you omit this parameter, the current account is used. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Dimensions.member.N The metric dimensions to create the anomaly detection model for. Type: Array of Dimension objects Array Members: Maximum number of 30 items. Required: No MetricName The name of the metric to create the anomaly detection model for. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No Namespace The namespace of the metric to create the anomaly detection model for. SingleMetricAnomalyDetector API Version 2010-08-01 247 Amazon CloudWatch Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: [^:].* Required: No Stat The statistic to use for the metric and anomaly detection model. Type: String Length Constraints: Maximum length of 50. Pattern: (SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm) (\d{1,2}(\.\d{0,10})?|100)|[ou]\d+(\.\d*)?)(_E|_L|_H)?|(TM|TC|TS| WM)\(((((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?:((\d{1,2})(\. \d{0,10})?|100(\.0{0,10})?)%|((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%: (((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?)\)|(TM|TC|TS|WM|PR)\(((\d +(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)):((\d+(\.\d{0,10})?|(\d +(\.\d{0,10})?[Ee][+-]?\d+)))?|((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee] [+-]?\d+)))?:(\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))\) Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also API Version 2010-08-01 248 Amazon CloudWatch StatisticSet Represents a set of statistics that describes a specific metric. API Reference Contents Maximum The maximum value of the sample set. Type: Double Required: Yes Minimum The minimum value of the sample set. Type: Double Required: Yes SampleCount The number of samples used for the statistic set. Type: Double Required: Yes Sum The sum of values for the sample set. Type: Double Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ StatisticSet API Version 2010-08-01 249 Amazon CloudWatch • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also API Version 2010-08-01 250 Amazon CloudWatch Tag A key-value pair associated with a CloudWatch resource. API Reference Contents Key A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Required: Yes Value The value for the specified tag key. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Tag API Version 2010-08-01 251 Amazon CloudWatch API Reference Dashboard Body Structure and Syntax Contents • Overall Structure • Widgets Array Structure • Variables Array Structure • Properties of a Log Widget Object • Properties of a Metric Widget Object • Metric Widget: Format for Each Metric in the Array • Properties of a Metrics Explorer Widget Object • Properties of an Alarm Status Widget Object Overall Structure A DashboardBody is a string in JSON format. It can include an array of between 0 and 500 widget objects, as well as a few other parameters. The dashboard must include a widgets array, but that array can be empty. The following is an example of this structure with one metric widget and one text widget, a time range starting six hours before the current time, and each graph's period setting always being obeyed. { "start": "-PT6H", "periodOverride": "inherit", "widgets": [ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ "AWS/EC2", "CPUUtilization", Overall Structure API Version 2010-08-01 252 Amazon CloudWatch API Reference "InstanceId", "i-012345" ] ], "period":300, "stat":"Average", "region":"us-east-1", "title":"EC2 Instance CPU", "liveData": false, "legend": { "position": "right" } } }, { "type":"text", "x":0, "y":7, "width":3, "height":3, "properties":{ "markdown":"Hello world" } } ] } The next example displays three Lambda per-function metrics, and uses a dashboard variable so that dashboard users can switch between different Lambda function names and see all three metrics for each function. This helps you create a single flexible dashboard that can display key metrics for different resources. In this example the functions are discovered by a metric search query, so the dashboard automatically discovers new Lambda functions when they are created. { "widgets": [{ "height": 6, "width": 6, "y": 0, "x": 0, "type": "metric", "properties": { "view": "timeSeries", "stacked": false, Overall Structure API Version 2010-08-01 253 Amazon CloudWatch API Reference "metrics": ["AWS/Lambda", "Invocations", "FunctionName", "my-function- name"], "region": "us-east-1", "liveData": true } }, { "height": |
acw-api-054 | acw-api.pdf | 54 | dashboard users can switch between different Lambda function names and see all three metrics for each function. This helps you create a single flexible dashboard that can display key metrics for different resources. In this example the functions are discovered by a metric search query, so the dashboard automatically discovers new Lambda functions when they are created. { "widgets": [{ "height": 6, "width": 6, "y": 0, "x": 0, "type": "metric", "properties": { "view": "timeSeries", "stacked": false, Overall Structure API Version 2010-08-01 253 Amazon CloudWatch API Reference "metrics": ["AWS/Lambda", "Invocations", "FunctionName", "my-function- name"], "region": "us-east-1", "liveData": true } }, { "height": 12, "width": 12, "y": 0, "x": 6, "type": "metric", "properties": { "view": "timeSeries", "stacked": false, "metrics": ["AWS/Lambda", "Errors", "FunctionName", "my-function- name"], "region": "us-east-1", "liveData": true } }, { "height": 3, "width": 6, "y": 0, "x": 18, "type": "metric", "properties": { "view": "timeSeries", "stacked": false, "metrics": ["AWS/Lambda", "Duration", "FunctionName", "my-function- name"], "region": "us-east-1", "liveData": true } } ], "variables": [{ "type": "property", "property": "FunctionName", Overall Structure API Version 2010-08-01 254 Amazon CloudWatch API Reference "inputType": "select", "id": "LambdaFunction_Variable", "label": "Function", "visible": true, "search": "{AWS/Lambda,FunctionName} MetricName=\"Duration\"", "populateFrom": "FunctionName" }] } The next example has two widgets. The first includes two metrics and a math expression that sums their total. The second widget is a search expression that displays the CPUUtilization for all EC2 instances in the Region. { "start": "-PT9H", "periodOverride": "inherit", "widgets": [ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-123",{ "id": "m1" } ], [ ".", ".", ".", "i-abc", { "id": "m2" } ], [ { "expression": "SUM(METRICS())", "label": "Sum of DiskReadbytes", "id": "e3" } ] ], "view": "timeSeries", "stacked": false, "period":300, "stat":"Average", "region":"us-east-1", "title":"EC2 Instance CPU" } }, { "type":"metric", "x":0, "y":0, Overall Structure API Version 2010-08-01 255 Amazon CloudWatch "width":18, "height":9, "properties":{ "metrics":[ [ { "expression": "SEARCH('{AWS/EC2,InstanceId} MetricName= \"CPUUtilization\"', 'Average', 300)", "id": "e1" } ] API Reference ], "view": "timeSeries", "stacked": false, "region":"us-east-1", "title":"EC2 Instance CPU" } } ] } The rest of this section includes examples illustrating each part of the DashboardBody syntax. For more examples showing the entire command syntax, see PutDashboard in the Amazon CloudWatch API Reference. The top level of the JSON object can include the following properties. widgets The list of widgets in the dashboard. For more information, see Widgets Array Structure. Required: Yes variables The array of dashboard variable objects used in the dashboard. For more information about the fields that you can use in each dashboard variable object, see Variables Array Structure. For more information about dashboard variables, see Create flexible dashboards with dashboard variables. If you include a variables array, it can contain between 0 and 25 variable objects. Required: No Overall Structure API Version 2010-08-01 256 Amazon CloudWatch end API Reference The end of the time range to use for each widget on the dashboard when the dashboard loads. If you specify a value for end, you must also specify a value for start. For each of these values, specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z. Type: String Required: No start The start of the time range to use for each widget on the dashboard. You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -PT if you specify a time range in minutes or hours, and must begin with -P if you specify a time range in days, weeks, or months. You can then use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT5M shows the last 5 minutes, -PT8H shows the last 8 hours, and - P3M shows the last three months. You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z. If you omit start, the dashboard shows the default time range when it loads. Type: String Required: No periodOverride Use this field to specify the period for the graphs when the dashboard loads. Specifying auto causes the period of all graphs on the dashboard to automatically adapt to the time range of the dashboard. Specifying inherit ensures that the period set for each graph is always obeyed. Valid Values: auto | inherit Type: String Required: No Overall Structure API Version 2010-08-01 257 Amazon CloudWatch API Reference Widgets Array Structure Each widget of any type can have the following properties. type The type of widget. Valid Values: metric | text | log | alarm | explorer Type: String Required: Yes x y The horizontal position of the widget on the 24-column dashboard grid. The default is the next available position. Valid Values: 0–23 Type: Integer Required: Yes, if |
acw-api-055 | acw-api.pdf | 55 | to the time range of the dashboard. Specifying inherit ensures that the period set for each graph is always obeyed. Valid Values: auto | inherit Type: String Required: No Overall Structure API Version 2010-08-01 257 Amazon CloudWatch API Reference Widgets Array Structure Each widget of any type can have the following properties. type The type of widget. Valid Values: metric | text | log | alarm | explorer Type: String Required: Yes x y The horizontal position of the widget on the 24-column dashboard grid. The default is the next available position. Valid Values: 0–23 Type: Integer Required: Yes, if y is specified. Otherwise not required. The vertical position of the widget on the 24-column dashboard grid. The default is the next available position. Valid Values: Any integer, 0 or higher. Type: Integer Required: Yes, if x is specified. Otherwise not required. width The width of the widget in grid units (in a 24-column grid). The default is 6. Valid Values: 1–24 Type: Integer Required: No Widgets Array Structure API Version 2010-08-01 258 Amazon CloudWatch height The height of the widget in grid units. The default is 6. API Reference Valid Values: 1–1000 Type: Integer Required: No properties The detailed properties of the widget, which differ depending on the widget type. For more information about the format of properties, see Properties of a Metric Widget Object or Properties of a Text Widget Object. Type: Object Required: Yes Variables Array Structure Each dashboard variable in the array can have the following properties. type The type of dashboard variable. CloudWatch supports two types, property variables and pattern variables. Property variables change the values of all instances of a property in all widgets in the dashboard. A property can be either of the following: • Any JSON property in the widget definitions, such as region. • Any dimension name for a metric, such as InstanceId or FunctionName. A pattern variable changes a regular expression pattern across the dashboard JSON. Use it when you need to change just part of a JSON property value, or even a JSON property. Property variables apply to most use cases and are less complex to set up. Valid Values: property | pattern Type: String Variables Array Structure API Version 2010-08-01 259 Amazon CloudWatch Required: Yes inputType API Reference Determines how the dashboard user inputs the value for the variable. • Specify input to use a text box that the user can enter values into. • Specify select to use a dropdown set of values that you define, or a dropdown list of values found by a metric search query. • Specify radio to use a set of radio buttons, with values that you define or that you find with a metric search query. Valid Values: input | select | radio Type: String Required: Yes values If your inputType is select or radio and you want to define the possible variable values instead of using a metric query search, specify those values here. values is an array where each object in the array contains a required value and an optional label. Each value can be a string, number, or Boolean, and each label must be a string. Each of these values and labels can be as many as 255 characters. If you specify a values array it must include at least one item, and can include as many as 500. For example, the following creates a list of three possible Regions to use as the values for a variable. "values": [ { "label": "US East (IAD)", "value": "us-east-1" }, { "label": "US West (SFO)", "value": "us-west-1" }, { "label": "EU (DUB)", "value": "eu-west-1" } ] Type: Array Required: Yes if inputType is select or radio and you are not using a metric search query to populate the values. Variables Array Structure API Version 2010-08-01 260 Amazon CloudWatch id API Reference An Id for this variable. It can be up to 32 characters, and valid characters are 0-9A-Za-z-_ Type: String Required: Yes label A label to display for the input field. It can have as many as 30 characters. If you omit this field for a property variable, the property name is displayed as the label. If you omit it for a pattern variable, then pattern_1, pattern_2, ... is used for the label. Type: String Required: No defaultValue The default value for the variable, when the dashboard is first opened. • If inputType is input, you specify the defaultValue here manually and use as many as 255 characters • If inputType is select or radio, you must specify a valid possible value that you specified in the values array or that was retrieved in the metric query search. Valid Values: Any valid value for this variable Type: String, Number, or Boolean, depending on the type value for this variable Required: |
acw-api-056 | acw-api.pdf | 56 | for a pattern variable, then pattern_1, pattern_2, ... is used for the label. Type: String Required: No defaultValue The default value for the variable, when the dashboard is first opened. • If inputType is input, you specify the defaultValue here manually and use as many as 255 characters • If inputType is select or radio, you must specify a valid possible value that you specified in the values array or that was retrieved in the metric query search. Valid Values: Any valid value for this variable Type: String, Number, or Boolean, depending on the type value for this variable Required: No search Specify this field to populate your select or radio input field by using a metric search expression. For the value for this field, specify a namespace, dimension name, and a metric name. The dimension that you specify must be valid for that metric. CloudWatch finds all resources that publish that metric and dimension, and populates the list with them. For example, specify "search": "{AWS/EC2,InstanceId} MetricName= \"CPUUtilization\"" to search for Amazon EC2 instances in the account, or specify Variables Array Structure API Version 2010-08-01 261 Amazon CloudWatch API Reference "search": "{AWS/Lambda,FunctionName} MetricName=\"Duration\"", to return the Lambda functions in the account The search string that you specify can be as many as 2048 characters. Note If you're using a search expression and you also want to specify a default value, the default that you specify in defaultValue is used as long as that default is one or the resources that was retrieved by the search. When using a search expression to populate your input field, you can also specify the special value __FIRST for defaultValue, to have the default value be the first value returned from the search. (The special value includes two underscores and then FIRST) Values returned by the search are always sorted alphabetically. Type: String Required: Yes if inputType is select or radio and you are not specifying values. populateFrom If you are using the search field to populate your input field by using a search expression, specify this field with the name of a dimension that the search will retrieve. For example, if your search value is "search": "{AWS/EC2,InstanceId} MetricName= \"CPUUtilization\"", then you can specify InstanceId for populateFrom. Type: String Required: Yes if inputType is select or radio and you are not specifying values. visible Specified whether the input label and field are visible on the dashboard. If you omit this, the default of true is used. Using false saves some room on the dashboard, but requires the user to change the dashboard URL to change the variable values. Type: Boolean Variables Array Structure API Version 2010-08-01 262 Amazon CloudWatch Required: No Variable examples API Reference The following example uses a property variable for changing the Region of all widgets, using a text input field. When the dashboard is first opened, the default value of us-east-1 is used for the variable. "variables": [ { "type": "property", "property": "region", "inputType": "input", "id": "region", "label": "Region", "defaultValue": "us-east-1", "visible": true } ], The following example uses a pattern variable for changing the Region of all widgets, in the case where sometimes the Region is set in the middle of a string such as an ARN. "variables": [ { "type": "pattern", "pattern": "us-east-1", "inputType": "input", "id": "region", "label": "Region", "defaultValue": "us-east-1", "visible": true } ], The following example generates a Lambda function variable, with a radio button for each function. Functions are discovered by a metric query search. "variables": [ { Variable examples API Version 2010-08-01 263 Amazon CloudWatch API Reference "type": "pattern", "pattern": "originalFuncNameInDashboard", "inputType": "radio", "id": "functionName", "label": "Function", "visible": true, "search": "{AWS/Lambda,FunctionName} MetricName=\"Duration\"", "populateFrom": "FunctionName", "defaultValue": "__FIRST" } ], The following sample displays how to specify multiple variables in a dashboard, and demonstrates several types of variables. "variables": [{ "type": "property", "property": "region", "inputType": "select", "id": "unique_id_1", "label": "Region", "defaultValue": "us-east-1", "visible": true, "values": [{ "label": "IAD", "value": "us-east-1" }, { "label": "CMH", "value": "us-east-2" }, { "label": "NRT", "value": "ap-northeast-1" } ] }, { "type": "property", "property": "FunctionName", "inputType": "select", "id": "unique_id_2", "label": "Function", Variable examples API Version 2010-08-01 264 Amazon CloudWatch API Reference "visible": true, "values": [{ "value": "my-FunctionName-1" }, { "value": "my-FunctionName-2" }, { "value": "my-FunctionName-3" } ] }, { "type": "property", "property": "accountId", "inputType": "radio", "id": "unique_id_3", "defaultValue": "111122223333", "visible": true, "values": [{ "label": "IAD Account", "value": "111122223333" }, { "label": "CMH Account", "value": "123456789012" }, { "label": "NRT Account", "value": "000000000000" } ] } ] Properties of a Text Widget Object A widget of type text can have one or two parameters in the properties section. The markdown field is required, and the transparent field is optional. For more information about the style of markdown supported in CloudWatch text widgets, see Using Markdown in the Console. Properties of a Text Widget |
acw-api-057 | acw-api.pdf | 57 | { "value": "my-FunctionName-3" } ] }, { "type": "property", "property": "accountId", "inputType": "radio", "id": "unique_id_3", "defaultValue": "111122223333", "visible": true, "values": [{ "label": "IAD Account", "value": "111122223333" }, { "label": "CMH Account", "value": "123456789012" }, { "label": "NRT Account", "value": "000000000000" } ] } ] Properties of a Text Widget Object A widget of type text can have one or two parameters in the properties section. The markdown field is required, and the transparent field is optional. For more information about the style of markdown supported in CloudWatch text widgets, see Using Markdown in the Console. Properties of a Text Widget Object API Version 2010-08-01 265 Amazon CloudWatch markdown API Reference The text to be displayed by the widget. Use this parameter only for text widgets. Type: String Required: Yes (when the widget type is text). background Specifies whether the text widget has a solid or transparent background. The value transparent makes the widget transparent. The value solid is the default. Type: String Required: No { "widgets":[ { "type":"text", "x":0, "y":7, "width":3, "height":3, "properties":{ "markdown":"Hello world", "background": "transparent" } } ] } Properties of a Log Widget Object A widget of type log represents the results of a CloudWatch Logs Insights query. For more information, see Analyzing Log Data with CloudWatch Logs Insights. A log widget can include the following fields in its properties field. accountId The account ID of the AWS account containing the logs, if this is a cross-account query. Properties of a Log Widget Object API Version 2010-08-01 266 API Reference Amazon CloudWatch Type: String Required: No region The Region of the logs query. Type: String Required: Yes title The title text to be displayed by the widget. Type: String Required: No query Contains the CloudWatch Logs Insights query function. Type: String Required: Yes (when the widget type is log). The query string starts with the names of the log groups that are to be queried. You must pre- pend each log group name with SOURCE. Separate multiple log groups with a pipe character (|). Add another pipe character after the list of log groups, and then specify the query syntax. Separate each line in the query syntax with \n| For example, the following line represents a query of two log groups, service_log1 and service_log2. The query displays canaries that have faults. "query": "SOURCE 'service_log1' | SOURCE 'service_log2' |filter Fault > 0\n| fields Fault.Message\n| stats count(*) by Canary.Name, Fault.Message" view Specifies how the query results are displayed. Specify table to view the results as a table. Specify timeSeries to display this metric as a line graph. Specify bar to display it as a bar graph. Specify pie to display it as a pie graph. Properties of a Log Widget Object API Version 2010-08-01 267 Amazon CloudWatch API Reference If you omit this parameter, the results are displayed as a table. Type: String Required: No (when the widget type is log). { "widgets": [ { "type": "log", "x": 12, "y": 24, "width": 12, "height": 6, "properties": { "region": "us-east-1", "title": "Errors (Application Log)", "query": "SOURCE 'application1.log' | SOURCE 'application2.log' | filter @message like \"[ERROR]\"\n| parse \"Error for [*] [*] due to: *\" canaryName1, canaryId1, cause1\n| parse \"Executor canary [*] *\" canaryName2, cause2\n| fields coalesce(cause1, cause2) as cause\n| fields coalesce(canaryName1, canaryName2) as canaryName\n| fields ispresent(cause) as isP\n| filter isP\n| stats count() as errCount by canaryName, substr(cause, 0, 130)\n| sort errCount DESC", "view": "table" } } ] } Properties of a Metric Widget Object A widget of type metric can have the following fields within properties: accountId Specifies the AWS account ID where all metrics in this widget will come from. This is useful for cross-account dashboards that include widgets from multiple accounts. For more information, see Cross-Account Cross-Region CloudWatch Console. If you omit this, the current account is used as the default. Use this parameter only for metric widgets. Properties of a Metric Widget Object API Version 2010-08-01 268 Amazon CloudWatch API Reference You can also use an accountId field within each metric in the array of metrics to create a single widget which includes metrics from multiple accounts. Type: String Required: No annotations To include an alarm or annotation in the widget, specify an annotations array. For more information about the format, see Dashboard Widget Object: Annotation Properties. Use this parameter only for metric widgets. Type: Object Required: An alarm annotation is required only when the widget type is metric and metrics is not specified. A horizontal or vertical annotation is not required. liveData Specify true to display live data in the widget. Live data is data published within the last minute that has not been fully aggregated. For more information, see Use Live Data. Type: Boolean Required: No legend Specify legend to determine where the legend for the lines on the graph is displayed. The legend field contains |
acw-api-058 | acw-api.pdf | 58 | about the format, see Dashboard Widget Object: Annotation Properties. Use this parameter only for metric widgets. Type: Object Required: An alarm annotation is required only when the widget type is metric and metrics is not specified. A horizontal or vertical annotation is not required. liveData Specify true to display live data in the widget. Live data is data published within the last minute that has not been fully aggregated. For more information, see Use Live Data. Type: Boolean Required: No legend Specify legend to determine where the legend for the lines on the graph is displayed. The legend field contains another field called position. Possible values for position are right, bottom, and hidden. For example, the following causes the legend to appear on the right in the graph. "legend": { "position": "right" } Type: Object Required: No Properties of a Metric Widget Object API Version 2010-08-01 269 Amazon CloudWatch metrics API Reference Specify a metrics array to include one or more metrics (without alarms), a Metrics Insights query, math expressions, or search expressions. One metrics array can include 0–500 metrics and expressions. Use this parameter only for metric widgets. For more information about the format of metrics, see Metric Widget: Format for Each Metric in the Array. One metrics array can include no more than one Metrics Insights query. A single expression field can't include both a Metrics Insights query and a math expression, but you can use the returned results of a Metrics Insights query from one expression as input in a math expression in a different expression in the array. Type: Array of arrays Required: Yes, when the widget type is metric and annotations is not specified. period The default period, in seconds, for all metrics in this widget. The period is the length of time represented by one data point on the graph. This default can be overridden within each metric definition. Use this parameter only for metric widgets. The default is 300. Valid Values: Any multiple of 60, with 60 as the minimum. Type: Integer Required: No region The region of the metric. Type: String Required: Yes sparkline Specify true to display the sparkline feature under the number widget. Specify false to display the number widget by itself. This parameter is ignored if view is not singleValue. Use this parameter only for metric widgets. Type: Boolean Required: No Properties of a Metric Widget Object API Version 2010-08-01 270 Amazon CloudWatch stacked API Reference Specify true to display the graph as a stacked line, or false to display as separate lines. This parameter is ignored if view is singleValue. Use this parameter only for metric widgets. Type: Boolean Required: No stat The default statistic to be displayed for each metric in the array. This default can be overridden within the definition of each individual metric in the metrics array. Use this parameter only for metric widgets. Valid Values: SampleCount | Average | Sum | Minimum | Maximum | p?? Type: String that is a valid CloudWatch statistic. Required: No table Include a table section to include data table-related changes in the widget. For more information about the format, see Dashboard Widget Object: Table Properties. Type: Object Required: No timezone The time zone to use for displaying the times in the graph. The format is + or - followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time 1 hour and 30 minutes ahead of UTC. The default is +0000. Type: String Required: No title The title to be displayed for the graph or number. Use this parameter only for metric widgets. Type: String Properties of a Metric Widget Object API Version 2010-08-01 271 Amazon CloudWatch Required: No view API Reference Specify timeSeries to display this metric as a line or stacked area graph. Specify singleValue to display this metric as a number graph. Specify gauge to display this metric as a gauge graph. Specify bar to display this metric as a bar graph. Specify pie to display this metric as a pie graph. Note If you specify gauge, you must set a value for min and max on the left side of yAxis. Valid Values: timeSeries | singleValue | gauge | bar | pie | table Type: String Required: No yAxis The minimum and maximum values for the left and right side of a graph's Y-axis. This property applies to all graphed metrics, except for specific metrics that override this setting. For more information, see Dashboard Widget Object: yAxis Properties Format. Type: yAxis object Required: No Example: Stacked area and gauge widgets { "widgets": [ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ Properties of a Metric Widget Object API Version 2010-08-01 |
acw-api-059 | acw-api.pdf | 59 | for min and max on the left side of yAxis. Valid Values: timeSeries | singleValue | gauge | bar | pie | table Type: String Required: No yAxis The minimum and maximum values for the left and right side of a graph's Y-axis. This property applies to all graphed metrics, except for specific metrics that override this setting. For more information, see Dashboard Widget Object: yAxis Properties Format. Type: yAxis object Required: No Example: Stacked area and gauge widgets { "widgets": [ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ Properties of a Metric Widget Object API Version 2010-08-01 272 Amazon CloudWatch API Reference "AWS/EC2", "CPUUtilization", "InstanceId", "i-012345" ], [ "AWS/EC2", "NetworkIn", "InstanceId", "i-012345", { "yAxis":"right", "label":"NetworkIn", "period":3600, "stat":"Maximum" } ] ], "period":300, "stat":"Average", "region":"us-east-1", "timezone":"+0300", "title":"EC2 Instance CPU", "stacked":true, "view":"timeSeries", "liveData":false, "yAxis":{ "left":{ "min":0, "max":100 }, "right":{ "min":50 } }, "annotations":{ "horizontal":[ { "visible":true, "color":"#9467bd", "label":"Critical range", "value":20, "fill":"above", "yAxis":"right" Properties of a Metric Widget Object API Version 2010-08-01 273 API Reference Amazon CloudWatch } ] } }, { "type": metric, "x": 18, "y"; 60, "width": 6, "height": 6, "properties": { "metrics": [ [ "AWSLogsShrinkRay", "disk_inodes_used", "path", "/dev/shm", "InstanceId", "i-012345", "AutoScalingGroupName", "ShrinkRayExecutorResourceStack-Gamma-us-east-1- ASGuseast1ac48xlargeASGB9B53974-VTYXJUZGUAHV", "InstanceType", "c4.8xlarge", "device", "tmpfs", "fstype", "tmpfs" ] ], "view": "gauge", "title": "Disk Inodes Used" "region": "us-east-1", "yAxis": { "left": { "min": 0, "max": 100, } } } } Properties of a Metric Widget Object API Version 2010-08-01 274 Amazon CloudWatch API Reference Metric Widget: Format for Each Metric in the Array Each item in the metrics array is either a single metric or a math expression or search expression. Each single metric in the metrics array has the following format: [ Namespace, MetricName, [{DimensionName,DimensionValue}...] {Rendering Properties Object} ] Each expression in the metrics array has the following format: [ {"expression" : "expression", ["label" : "label"] , ["id" : "id"] } ] accountId Specifies the AWS account ID where this metric comes from. This enables you to create a widget that contains metrics from multiple accounts on a cross-account dashboard. For more information, see Cross-Account Cross-Region CloudWatch Console. If you omit this, the current account is used as the default. Use this parameter only for metric widgets. Type: String Required: No Namespace The AWS namespace containing the metric. If you have multiple entries in the metrics array, for each one after the first you may specify only "." to use the same namespace as the previous metric in the array. Type: String Required: Yes MetricName The name of the CloudWatch metric. If you have multiple entries in the metrics array, for each one after the first you may specify only "." to use the same metric name as the previous metric in the array. Type: String Metric Widget: Format for Each Metric in the Array API Version 2010-08-01 275 Amazon CloudWatch API Reference Required: Yes, for a single metric expression The Metrics Insights query, math expression, or search expression, if this is an expression instead of a single metric. In a search expression using double-quotes for an exact match, each double-quote mark must be escaped with a backslash. For more information about Metrics Insights query syntax, see Metrics Insights query components and syntax. For more information about math expressions or search expressions, see Using Metric Math or Using Search Expressions in Graphs in the Amazon CloudWatch User Guide. Type: String Required: Yes, for an expression Example of an expression for a Metrics Insights query: [ { "expression": "SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId) GROUP BY InstanceId LIMIT 10", "label": "View the 10 max CPU Utilization", "id": "q1" } ] DimensionName The name of a dimension to further refine what data is shown. If you have multiple entries in the metrics array, for each one after the first you may specify only "." to use the same dimension name as in the corresponding dimension specified in the previous metric in the array. You may specify 0 dimensions for a metric, or up to as many dimensions as the metric support. Type: String Required: No DimensionValue The value to use for that dimension for the metric. Required if there is a corresponding dimension name. Type: String Metric Widget: Format for Each Metric in the Array API Version 2010-08-01 276 Amazon CloudWatch Required: No id API Reference The Id of this time series. This Id can be used as part of a math expression. The Id must start with a lowercase letter. Type: String Required: No label The label to display in the graph to represent this time series. Type: String Required: No region The region of the metric. Use this parameter only for metric widgets. If you omit this, the current Region is used as the default. Type: String Required: No Rendering Properties Object Specifies rendering properties to be used for this particular metric, overriding the values specified for |
acw-api-060 | acw-api.pdf | 60 | Amazon CloudWatch Required: No id API Reference The Id of this time series. This Id can be used as part of a math expression. The Id must start with a lowercase letter. Type: String Required: No label The label to display in the graph to represent this time series. Type: String Required: No region The region of the metric. Use this parameter only for metric widgets. If you omit this, the current Region is used as the default. Type: String Required: No Rendering Properties Object Specifies rendering properties to be used for this particular metric, overriding the values specified for the overall widget. For more information about the format, see Dashboard Widget Object: Rendering Properties Object Format. Type: Metric Render Properties Object Required: No // The simplest example, a metric with no dimensions [ "AWS/EC2", "CPUUtilization" ] // A metric with a single dimension [ "AWS/EC2", "CPUUtilization", "InstanceId", "i-012345" ] // A metric with a single dimension and rendering properties [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-xyz", { "yAxis": "right"} ] Metric Widget: Format for Each Metric in the Array API Version 2010-08-01 277 Amazon CloudWatch API Reference // The following example graphs the DiskReadBytes metric for three instances. [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-xyz" ], [ ".", ".", ".", "i-abc" ], [ ".", ".", ".", "i-123" ] // The following example includes two metrics and a math expression to sum them. [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-123",{ "id": "m1" } ], [ ".", ".", ".", "i-abc", { "id": "m2" } ], [ { "expression": "SUM(METRICS())", "label": "Sum of DiskReadbytes", "id": "e3" } ] // The following example is a search expression showing the EC2 CPUUtilization for each instance in the Region. [ { "expression": "SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 300)", "id": "e1" } ], Topics • Dashboard Widget Object: Rendering Properties Object Format • Dashboard Widget Object: Annotation Properties • Dashboard Widget Object: yAxis Properties Format • Dashboard Widget Object: Table Properties Dashboard Widget Object: Rendering Properties Object Format Each metric in the metrics array can optionally have custom rendering properties that override the default rendering properties specified in the yAxis parameter of the widget object. This section describes the format for those per-metric custom rendering properties. color The six-digit HTML hex color code to be used for this metric. Type: String Required: No label The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget. Dashboard Widget Object: Rendering Properties Object Format API Version 2010-08-01 278 Amazon CloudWatch Type: String Required: No period API Reference The period for this metric, in seconds. The period is the length of time represented by one data point on the graph. Valid Values: A multiple of 60, with a minimum of 60. Type: Integer Required: No stat The statistic for this metric, if it is to be different than the statistic used for the other metrics in the array. Valid Values: SampleCount | Average | Sum | Minimum | Maximum | p?? Type: String that is a valid CloudWatch statistic. Required: No visible Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true. Type: Boolean Required: No yAxis Where on the graph to display the y-axis for this metric. The default is left. Valid Values: left | right Type: String Required: No Dashboard Widget Object: Rendering Properties Object Format API Version 2010-08-01 279 Amazon CloudWatch API Reference // The third metric has its own rendering properties, overriding those of the rest of the widget. [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-xyz" ], [ ".", ".", ".", "i-abc" ], [ ".", ".", ".", "i-123", { "label":"Instance i-123", "yAxis": "right"} ] Dashboard Widget Object: Annotation Properties Annotations include alarms, horizontal annotations, and vertical annotations. A single metric widget can have up to one alarm, or it can have one or more horizontal or vertical annotations. A single widget can't have both an alarm and horizontal or vertical annotations. Alarm Annotations If you specify an alarm annotation, you cannot also specify a metrics array in the same widget. alarms The Amazon Resource Name (ARN) of the alarm. Type: Array of strings. There can be 0–1 strings in the array. Required: Only if no metrics are listed. "annotations": { "alarms": [ "arn1" ] } Horizontal Annotations horizontal An array of horizontal annotations. Horizontal annotations have several options for fill shading, including shading above the annotation line, shading below the annotation line, and "band" shading that appears between two linked annotation lines as part of a single band annotation. Each horizontal annotation in the array that is a single annotation, instead of a band annotation, has the following format: Dashboard Widget Object: Annotation Properties API Version 2010-08-01 280 Amazon CloudWatch |
acw-api-061 | acw-api.pdf | 61 | Array of strings. There can be 0–1 strings in the array. Required: Only if no metrics are listed. "annotations": { "alarms": [ "arn1" ] } Horizontal Annotations horizontal An array of horizontal annotations. Horizontal annotations have several options for fill shading, including shading above the annotation line, shading below the annotation line, and "band" shading that appears between two linked annotation lines as part of a single band annotation. Each horizontal annotation in the array that is a single annotation, instead of a band annotation, has the following format: Dashboard Widget Object: Annotation Properties API Version 2010-08-01 280 Amazon CloudWatch API Reference {value, label, color, fill, yAxis, visible} Each horizontal annotation that is a band annotation has the following format: [ {value, label, color, yAxis, visible}, {value, label} ] value The metric value in the graph where the horizontal annotation line is to appear. On a band shading annotation, the two values for Value define the upper and lower edges of the band. On a graph with horizontal annotations, the graph is scaled so that all visible horizontal annotations appear on the graph. Type: Float Required: Yes label A string that appears on the graph next to the annotation. Type: String Required: No color The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading. Type: String Required: No fill How to use fill shading with the annotation. Valid values are above for shading above the annotation, below for shading below the annotation, and none for no shading. If fill is omitted, there is no shading. The exception is an annotation with band shading. These annotations always have shading between the two values, and any value for fill is ignored. Dashboard Widget Object: Annotation Properties API Version 2010-08-01 281 Amazon CloudWatch Type: String Required: No visible API Reference Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true. Type: Boolean Required: No yAxis If the graph includes multiple metrics, specifies whether the numbers in Value refer to the metric associated with the left Y-axis or the right Y-axis, . Valid values are right and left. Type: String Required: No // A single horizontal annotation with fill shading above the annotation line, based on the metric associated with the right Y-axis "annotations": { "horizontal": [ { "visible":true, "color":"#9467bd", "label":"Critical range", "value":20, "fill":"above", "yAxis":"right" } ] } // A band annotation. Each value has a label, but other parameters for the band are specified only with the first number "annotations": { "horizontal": [ [ Dashboard Widget Object: Annotation Properties API Version 2010-08-01 282 API Reference Amazon CloudWatch { "label": "Band top", "value": 200, "color": "#9467bd", "visible": true, "yAxis": "right" }, { "value": 95.5, "label": "Band bottom" } ] ] } // Three annotations on a graph. The first one is a band annotation. The final one is hidden. "annotations": { "horizontal": [ [ { "label": "Band top", "value": 200, "color": "#9467bd", "visible": true, "yAxis": "right" }, { "value": 95.5, "label": "Band bottom" } ], { "visible": true, "color": "#9467bd", "label": "Label for this annotation", "value": 20, "fill": "below", "yAxis": "right" }, { "visible": false, "color": "#aaa", Dashboard Widget Object: Annotation Properties API Version 2010-08-01 283 Amazon CloudWatch API Reference "label": "Hidden annotation", "value": 150 } ] } Vertical Annotations vertical An array of vertical annotations. For each vertical annotation, you can choose to have fill shading before the annotation, after it, or between two vertical lines that are linked as a single band annotation. Each vertical annotation in the array that is a single annotation, instead of a band annotation, has the following format: {value, label, color, fill, visible} Each vertical annotation that is a band annotation has the following format: [ {value, label, color, visible}, {value, label} ] value The date and time in the graph where the vertical annotation line is to appear. On a band shading annotation, the two values for Value define the beginning and ending edges of the band. On a graph with vertical annotations, the graph is scaled so that all visible vertical annotations appear on the graph. This is defined as a string in ISO 8601 format. For more information, see ISO 8601. Type: String Required: Yes label A string that appears on the graph next to the annotation. Dashboard Widget Object: Annotation Properties API Version 2010-08-01 284 Amazon CloudWatch Type: String Required: No color API Reference The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading. Type: String Required: No fill How to use fill shading with the annotation. Valid values are before for shading before the annotation, after for shading after |
acw-api-062 | acw-api.pdf | 62 | is defined as a string in ISO 8601 format. For more information, see ISO 8601. Type: String Required: Yes label A string that appears on the graph next to the annotation. Dashboard Widget Object: Annotation Properties API Version 2010-08-01 284 Amazon CloudWatch Type: String Required: No color API Reference The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading. Type: String Required: No fill How to use fill shading with the annotation. Valid values are before for shading before the annotation, after for shading after the annotation, and none for no shading. If fill is omitted, there is no shading. The exception is an annotation with band shading. These annotations always have shading between the two values, and any value for fill is ignored. Type: String Required: No visible Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true. Type: Boolean Required: No // A single vertical annotation with fill shading after the annotation line "annotations": { "vertical": [ { "visible": true, "color": "#9467bd", "label": "Bug fix deployed", Dashboard Widget Object: Annotation Properties API Version 2010-08-01 285 Amazon CloudWatch API Reference "value": "2018-08-28T15:25:26Z", "fill": "after" } ] } // A band vertical annotation. Each annotation line has a label, but other parameters for the band are specified only with the first value "annotations": { "vertical": [ [ { "label": "Band start", "value": "2018-08-27T15:25:26Z", "color": "#9467bd", "visible": true }, { "value": "2018-08-28T15:25:26Z", "label": "Band end" } ] ] } Dashboard Widget Object: yAxis Properties Format Defines the settings for the Y-axis of the graph. The settings include the maximum and minimum, a label for the axis, and whether the axis shows the units. Set this within the widget object to affect all metrics in the widget. To override the widget settings for a particular metric, set it for the metric in the metrics array. { left: { min: 0, max: 100 }, right: { min: 0 } Dashboard Widget Object: yAxis Properties Format API Version 2010-08-01 286 Amazon CloudWatch API Reference } left Optional settings for the left Y-axis. Type: YAxis object Required: No right Optional settings for the right Y-axis. Type: YAxis object Required: No Each of the left and right objects can include the following parameters: label A label for this Y-axis Type: String Required: No min The minimum value for this Y-axis Type: Float Required: No max The maximum value for this Y-axis Type: Float Required: No Dashboard Widget Object: yAxis Properties Format API Version 2010-08-01 287 Amazon CloudWatch showUnits API Reference Determines whether the units are shown for the metric associated with this axis. The default is true. Type: Boolean Required: No Dashboard Widget Object: Table Properties If you specify table for a metric widget, you can include visualisations related to the visibility of summary columns, datapoint columns, and the table layout. These properties take affect only when the widget view type is table and don't alter other view types if included. The table property is not required to use a table widget. layout Use this field to transform the table such that the data points extend vertically or horizontally. The default is horizontal. Valid Values: vertical | horizontal Type: String Required: No stickySummary Set this to true to make the summary columns that you include in the table sticky, so you can explore the data columns while always having the summary columns in your viewport. The default is false. The widget label is always sticky, no matter your choice in this field. Valid Values: true | false Type: Boolean Required: No Dashboard Widget Object: Table Properties API Version 2010-08-01 288 Amazon CloudWatch showTimeSeriesData API Reference Set this to false if you want only the label and summary columns to be displayed, hiding the other columns of data. The default is true. Valid Values: true | false Type: Boolean Required: No summaryColumns Summary columns are a new property introduced with the table widget. These columns are a specific subset of summaries of your current table. For example, the Sum summary is a sum of all the rendered datapoints in its respective row. Summary columns are not that same concept as any CloudWatch metric statistic. The default is [“MIN“, "MAX","SUM", "AVG"] Valid Values: "MIN" | "MAX"| "SUM"| "AVG" Type: Array Required: No For example, the following JSON creates a table displaying the minimum and maximum of each metric in the table. "table": { "summaryColumns": ["MIN", "MAX"], "layout": "vertical", "stickySummary": true, "showTimeSeriesData": false, }, Properties of a Metrics Explorer Widget Object A widget of type explorer represents a metrics explorer widget. For more information, see Use Metrics Explorer to Monitor Resources by Their Tags and Properties Properties of a Metrics Explorer |
acw-api-063 | acw-api.pdf | 63 | its respective row. Summary columns are not that same concept as any CloudWatch metric statistic. The default is [“MIN“, "MAX","SUM", "AVG"] Valid Values: "MIN" | "MAX"| "SUM"| "AVG" Type: Array Required: No For example, the following JSON creates a table displaying the minimum and maximum of each metric in the table. "table": { "summaryColumns": ["MIN", "MAX"], "layout": "vertical", "stickySummary": true, "showTimeSeriesData": false, }, Properties of a Metrics Explorer Widget Object A widget of type explorer represents a metrics explorer widget. For more information, see Use Metrics Explorer to Monitor Resources by Their Tags and Properties Properties of a Metrics Explorer Widget Object API Version 2010-08-01 289 Amazon CloudWatch API Reference You can also add metrics explorer widgets to a dashboard using AWS CloudFormation. For more information, see AWS::CloudWatch::Dashboard. This widget type can have the following fields within the widget properties: aggregateBy An object that specifies how to aggregate metrics from multiple resources. The valid values for the key field in this object are the keys of tags and resource properties. This object contains the following fields. • key– The tag or resource property key to use for aggregating the metrics. • func– The aggregation function to use. Valid values are AVG | MIN | MAX | STDDEV | SUM Type: Object Required: No labels An array of the tags or the resource properties that are used to determine which metrics are displayed in the widget. If you specify different keys, then only the resources that match all of the key/value pairs are displayed. If you specify multiple values for a single key, then resources that match any of the values for that key are displayed. • key– The tag or resource property to filter on. For key, all tag keys are valid to be specified. The following EC2 and Lambda resource properties are also valid for key: • EC2: Architecture, Hypervisor, CoreCount, ImageId, InstanceId, InstanceLifecycle, InstanceType, InstanceFamily, InstanceSize, Affinity, AvailabilityZone, Tenancy, Platform, RootDeviceType SecurityGroups, State, SubnetId, VirtualizationType, and VpcId • Lambda: FunctionName, Runtime, Language, MemorySize, Version, SecurityGroupIds, SubnetIds, SubnetIdCount, VpcId, and Timeout Properties of a Metrics Explorer Widget Object API Version 2010-08-01 290 Amazon CloudWatch API Reference • value– (Optional) The value of the tag or resource property to filter on. If this is omitted, metrics corresponding to all values of that tag or resource property are displayed. Type: Object Required: Yes metrics Specify a metrics array to include one or more metrics. One metrics array can include 1–100 metrics. Each object in the array must contain the following fields. • metricName– The name of the metric. • resourceType– The type of resource publishing the metric, described in the format used by AWS CloudFormation. For example, AWS::EC2::Instance or AWS::Lambda::Function. You must use the same value for resourceType for all metrics in the widget. For a complete list of valid values, see Valid resourceType Values for a Metric Explorer Widget Object. • stat– The statistic for this metric. Valid Values: SampleCount | Average | Sum | Minimum | Maximum | p?? Type: Array of objects Required: Yes period The default period, in seconds, for all metrics in this widget. The period is the length of time represented by one data point on the graph. The default is 300. Valid Values: Any multiple of 60, with 60 as the minimum. Type: Integer Required: No splitBy Specifies how to split the metrics from multiple resources into different lines on a graph, or into different graphs. The valid values are the keys of tags, and the keys of resource properties. Properties of a Metrics Explorer Widget Object API Version 2010-08-01 291 Amazon CloudWatch Type: String Required: No title API Reference The title to be displayed for the widget. The default is Explorer. Type: String Required: No widgetOptions An object that specifies how the widget appears on the dashboard. It can contain the following fields. • legend– Determines where the legend for each graph is displayed. The legend field contains another field called position. Possible values for position are right, bottom, and hidden. For example, the following causes the legend to appear on the right in the graph. "legend": { "position": "right" } • rowsPerPage– Specifies how many rows of graphs are displayed per page in the widget. • stacked– Specify true to display the graph as a stacked area chart, or false to display as separate lines. • view– Specifies how each graph is displayed. Specify timeSeries to display this metric as a line graph. Specify bar to display it as a bar graph. Specify pie to display it as a pie graph. The default is timeSeries. • widgetsPerRow– Specifies how many graphs are displayed in each row of the metrics explorer widget. Properties of a Metrics Explorer Widget Object API Version 2010-08-01 292 Amazon CloudWatch Type: Object Required: No Example API Reference The |
acw-api-064 | acw-api.pdf | 64 | in the widget. • stacked– Specify true to display the graph as a stacked area chart, or false to display as separate lines. • view– Specifies how each graph is displayed. Specify timeSeries to display this metric as a line graph. Specify bar to display it as a bar graph. Specify pie to display it as a pie graph. The default is timeSeries. • widgetsPerRow– Specifies how many graphs are displayed in each row of the metrics explorer widget. Properties of a Metrics Explorer Widget Object API Version 2010-08-01 292 Amazon CloudWatch Type: Object Required: No Example API Reference The following example displays three metrics for each of the account's running EC2 instances, with the graphs in the widget split by availability zone. Within each graph, the metrics are aggregated by instance type. { "widgets": [ { "type": "explorer", "width": 24, "height": 15, "x": 0, "y": 0, "properties": { "metrics": [ { "metricName": "CPUUtilization", "resourceType": "AWS::EC2::Instance", "stat": "Average" }, { "metricName": "NetworkIn", "resourceType": "AWS::EC2::Instance", "stat": "Average" }, { "metricName": "NetworkOut", "resourceType": "AWS::EC2::Instance", "stat": "Average" } ], "aggregateBy": { "key": "InstanceType", "func": "MAX" }, "labels": [ { "key": "State", Properties of a Metrics Explorer Widget Object API Version 2010-08-01 293 Amazon CloudWatch API Reference "value": "running" } ], "widgetOptions": { "legend": { "position": "bottom" }, "view": "timeSeries", "rowsPerPage": 8, "widgetsPerRow": 2 }, "period": 300, "splitBy": "AvailabilityZone", "title": "Running EC2 Instances by AZ" } } ] } Valid resourceType Values for a Metric Explorer Widget Object The valid values for the resourceType field in the metrics section of a metrics explorer widget are as follows: • AWS::AmazonMQ::Broker • AWS::ApiGateway::RestApi • AWS::AppStream::Fleet • AWS::AppSync::GraphQLApi • AWS::CloudFront::Distribution • AWS::CodeBuild::Project • AWS::Datasync::Agent • AWS::Datasync::Task • AWS::DMS::ReplicationInstance • AWS::DynamoDB::Table • AWS::EC2::CapacityReservation • AWS::EC2::Instance • AWS::EC2::NatGateway Valid resourceType Values for a Metric Explorer Widget Object API Version 2010-08-01 294 Amazon CloudWatch API Reference • AWS::EC2::TransitGateway • AWS::EC2::Volume • AWS::EC2::VPNConnection • AWS::ECS::Cluster • AWS::EFS::FileSystem • AWS::ElastiCache::CacheCluster • AWS::ElastiCache::ReplicationGroup • AWS::ElasticBeanstalk::Environment • AWS::ElasticLoadBalancing::LoadBalancer • AWS::ElasticLoadBalancingV2::LoadBalancer/ApplicationELB • AWS::ElasticLoadBalancingV2::LoadBalancer/GatewayELB • AWS::ElasticLoadBalancingV2::LoadBalancer/NetworkELB • AWS::ElasticLoadBalancingV2::TargetGroup • AWS::EMR::Cluster • AWS::Events::Rule • AWS::FSx::FileSystem • AWS::GameLift::Fleet • AWS::GlobalAccelerator::Accelerator • AWS::IoT::TopicRule • AWS::IoT1Click::Device • AWS::IoTAnalytics::Channel • AWS::IoTAnalytics::Dataset • AWS::IoTAnalytics::Datastore • AWS::IoTAnalytics::Pipeline • AWS::Kafka::Cluster • AWS::Kinesis::Stream • AWS::KinesisAnalytics::Application • AWS::KinesisFirehose::DeliveryStream • AWS::KinesisVideo::Stream • AWS::KMS::Key Valid resourceType Values for a Metric Explorer Widget Object API Version 2010-08-01 295 API Reference Amazon CloudWatch • AWS::Lambda::Function • AWS::Logs::LogGroup • AWS::MediaPackage::Channel • AWS::MediaStore::Container • AWS::OpsWorks::Instance • AWS::OpsWorks::Layer • AWS::OpsWorks::Stack • AWS::QLDB::Ledger • AWS::RDS::DBInstance • AWS::Redshift::Cluster • AWS::RoboMaker::SimulationJob • AWS::Route53::HealthCheck • AWS::Route53Resolver::ResolverEndpoint • AWS::S3::Bucket • AWS::SageMaker::Endpoint • AWS::ServiceCatalog::CloudFormationProduct • AWS::SES::ConfigurationSet • AWS::SNS::Topic • AWS::SQS::Queue • AWS::StepFunctions::Activity • AWS::StepFunctions::StateMachine • AWS::StorageGateway::Gateway • AWS::Synthetics::Canary • AWS::Transfer::Server • AWS::WorkMail::Organization • AWS::WorkSpaces::Workspace Properties of an Alarm Status Widget Object A widget of type alarm can have the following fields within properties. Properties of an Alarm Status Widget Object API Version 2010-08-01 296 Amazon CloudWatch alarms API Reference An array of alarm ARNs to include in the widget. The array can have 1-100 ARNs. Type: Array of strings Required: Yes (when the widget type is alarm). sortBy Specifies how to sort the alarms in the widget. Choose default to sort them in alphabetical order by alarm name. Choose stateUpdatedTimestamp to sort them first by alarm state, with alarms in ALARM state first, INSUFFICIENT_DATA alarms next, and OK alarms last. Within each group, the alarms are sorted by when they last changed state, with more recent state changes listed first. Choose timestamp to sort them by the time when the alarms most recently changed state, no matter the current alarm state. The alarm that changed state most recently is listed first. If you omit this field, the alarms are sorted in alphabetical order. Type: String Valid Values: default | stateUpdatedTimestamp | timestamp Required: No states Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states. You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK. If you omit this field or specify an empty array, all the alarms specifed in alarms are displayed. Type: Array of strings Required: No title The title text to be displayed by the widget. Properties of an Alarm Status Widget Object API Version 2010-08-01 297 Amazon CloudWatch Type: String Required: No API Reference The following example is an alarm status widget that displays four alarms specified by name, no matter their current state: { "type": "alarm", "x": 0, "y": 0, "width": 12, "height": 6, "properties": { "alarms": [ "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2BackendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2BackendCPU" ], "sortBy": "stateUpdatedTimestamp", "title": "All EC2 CPU alarms" } } The following example widget specifies the same four alarms, but the widget displays only the alarms that are currently in ALARM or INSUFFICIENT_DATA state: { "type": "alarm", "x": 0, "y": 0, "width": 12, "height": |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.