id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
69331965976c-2 | import java.nio.charset.StandardCharsets;
import java.util.Objects;
public class ImportCertificateAuthorityCertificate {
public static ByteBuffer stringToByteBuffer(final String string) {
if (Objects.isNull(string)) {
return null;
}
byte[] bytes = string.getBytes(StandardCharsets.UTF_8);
return ByteBuffer.wrap(bytes);
}
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from disk", e);
}
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint = | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ImportCertificateAuthorityCertificate.md |
69331965976c-3 | EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create the request object and set the signed certificate, chain and CA ARN.
ImportCertificateAuthorityCertificateRequest req =
new ImportCertificateAuthorityCertificateRequest();
// Set the signed certificate.
String strCertificate =
"-----BEGIN CERTIFICATE-----\n" +
"base64-encoded certificate\n" +
"-----END CERTIFICATE-----\n";
ByteBuffer certByteBuffer = stringToByteBuffer(strCertificate);
req.setCertificate(certByteBuffer);
// Set the certificate chain.
String strCertificateChain =
"-----BEGIN CERTIFICATE-----\n" +
"base64-encoded certificate\n" + | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ImportCertificateAuthorityCertificate.md |
69331965976c-4 | "-----BEGIN CERTIFICATE-----\n" +
"base64-encoded certificate\n" +
"-----END CERTIFICATE-----\n";
ByteBuffer chainByteBuffer = stringToByteBuffer(strCertificateChain);
req.setCertificateChain(chainByteBuffer);
// Set the certificate authority ARN.
req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account: " +
"certificate-authority/12345678-1234-1234-1234-123456789012");
// Import the certificate.
try {
client.importCertificateAuthorityCertificate(req);
} catch (CertificateMismatchException ex) {
throw ex;
} catch (MalformedCertificateException ex) {
throw ex;
} catch (InvalidArnException ex) {
throw ex;
} catch (ResourceNotFoundException ex) {
throw ex;
} catch (RequestInProgressException ex) {
throw ex;
} catch (ConcurrentModificationException ex) {
throw ex;
} catch (RequestFailedException ex) {
throw ex;
}
} | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ImportCertificateAuthorityCertificate.md |
69331965976c-5 | throw ex;
} catch (RequestFailedException ex) {
throw ex;
}
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ImportCertificateAuthorityCertificate.md |
a9daf42b2934-0 | The following CloudTrail example shows the results of a call to the [TagCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html) operation\.
```
{
"eventVersion":"1.05",
"userIdentity":{
"type":"IAMUser",
"principalId":"account",
"arn":"arn:aws:iam::account:user/name",
"accountId":"account",
"accessKeyId":"Key_ID"
},
"eventTime":"2018-02-02T00:18:48Z",
"eventSource":"acm-pca.amazonaws.com",
"eventName":"TagCertificateAuthority",
"awsRegion":"us-east-1",
"sourceIPAddress":"xx.xx.xx.xx",
"userAgent":"aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32",
"requestParameters":{ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-TagPCA.md |
a9daf42b2934-1 | "requestParameters":{
"certificateAuthorityArn":"arn:aws:acm-pca:us-east-1:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1",
"tags":[
{
"key":"Admin",
"value":"Alice"
}
]
},
"responseElements":null,
"requestID":"816df59d-5022-47af-aa58-173e5c73c20a",
"eventID":"8c99648b-3d77-483f-b56b-5aaa85cb6cde",
"eventType":"AwsApiCall",
"recipientAccountId":"account"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-TagPCA.md |
d2fa51d0a29b-0 | The following Java sample shows how to use the [CreatePermission](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html) operation\.
The operation assigns access permissions from a private CA to a designated AWS service principal\. Services can be given permission to create and retrieve certificates from a private CA, as well as list the active permissions that the private CA has granted\. In order to automatically renew certificates through ACM, you must assign all possible permissions \(`IssueCertificate, GetCertificate, and ListPermissions`\) from the CA to the ACM service principal \(`acm.amazonaws.com`\)\. You can find a CA's ARN by calling the [ListCertificateAuthorities](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html) function\.
Once a permission is created, you can inspect it with the [ListPermissions](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html) function or delete it with the [DeletePermission](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html) function\.
```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePermission.md |
d2fa51d0a29b-1 | ```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.AmazonClientException;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.services.acmpca.AWSACMPCA;
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder;
import com.amazonaws.services.acmpca.model.CreatePermissionRequest;
import com.amazonaws.services.acmpca.model.CreatePermissionResult;
import com.amazonaws.services.acmpca.model.InvalidArnException;
import com.amazonaws.services.acmpca.model.InvalidStateException;
import com.amazonaws.services.acmpca.model.LimitExceededException;
import com.amazonaws.services.acmpca.model.PermissionAlreadyExistsException;
import com.amazonaws.services.acmpca.model.RequestFailedException; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePermission.md |
d2fa51d0a29b-2 | import com.amazonaws.services.acmpca.model.RequestFailedException;
import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
import java.util.ArrayList;
public class CreatePermission {
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from file.", e);
}
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard() | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePermission.md |
d2fa51d0a29b-3 | // Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create a request object.
CreatePermissionRequest req =
new CreatePermissionRequest();
// Set the certificate authority ARN.
req.setCertificateAuthorityArn("arn:aws:acm-pca:region:account:" +
"certificate-authority/12345678-1234-1234-1234-123456789012");
// Set the permissions to give the user.
ArrayList<String> permissions = new ArrayList<>();
permissions.add("IssueCertificate");
permissions.add("GetCertificate");
permissions.add("ListPermissions");
req.setActions(permissions);
// Set the AWS principal.
req.setPrincipal("acm.amazonaws.com");
// Create a result object.
CreatePermissionResult result = null;
try {
result = client.createPermission(req); | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePermission.md |
d2fa51d0a29b-4 | CreatePermissionResult result = null;
try {
result = client.createPermission(req);
} catch (InvalidArnException ex) {
throw ex;
} catch (InvalidStateException ex) {
throw ex;
} catch (LimitExceededException ex) {
throw ex;
} catch (PermissionAlreadyExistsException ex) {
throw ex;
} catch (RequestFailedException ex) {
throw ex;
} catch (ResourceNotFoundException ex) {
throw ex;
}
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePermission.md |
7337b62ef686-0 | The following Java sample shows how to use the [GetCertificateAuthorityCsr](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCsr.html) operation\.
This operation retrieves the certificate signing request \(CSR\) for your private certificate authority \(CA\)\. The CSR is created when you call the [CreateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) operation\. Take the CSR to your on\-premises X\.509 infrastructure and sign it using your root or a subordinate CA\. Then import the signed certificate back into ACM PCA by calling the [ImportCertificateAuthorityCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html) operation\. The CSR is returned as a base64\-encoded string in PEM format\.
```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCertificateAuthorityCsr.md |
7337b62ef686-1 | import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.services.acmpca.AWSACMPCA;
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder;
import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCsrRequest;
import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCsrResult;
import com.amazonaws.AmazonClientException;
import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
import com.amazonaws.services.acmpca.model.InvalidArnException;
import com.amazonaws.services.acmpca.model.RequestInProgressException;
import com.amazonaws.services.acmpca.model.RequestFailedException;
import com.amazonaws.services.acmpca.model.AWSACMPCAException;
import com.amazonaws.waiters.Waiter;
import com.amazonaws.waiters.WaiterParameters;
import com.amazonaws.waiters.WaiterTimedOutException;
import com.amazonaws.waiters.WaiterUnrecoverableException; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCertificateAuthorityCsr.md |
7337b62ef686-2 | import com.amazonaws.waiters.WaiterUnrecoverableException;
public class GetCertificateAuthorityCsr {
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from disk", e);
}
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials)) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCertificateAuthorityCsr.md |
7337b62ef686-3 | .withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create the request object and set the CA ARN.
GetCertificateAuthorityCsrRequest req = new GetCertificateAuthorityCsrRequest();
req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account: " +
"certificate-authority/12345678-1234-1234-1234-123456789012");
// Create waiter to wait on successful creation of the CSR file.
Waiter<GetCertificateAuthorityCsrRequest> waiter = client.waiters().certificateAuthorityCSRCreated();
try {
waiter.run(new WaiterParameters<>(req));
} catch (WaiterUnrecoverableException e) {
//Explicit short circuit when the recourse transitions into
//an undesired state.
} catch (WaiterTimedOutException e) {
//Failed to transition into desired state even after polling.
} catch (AWSACMPCAException e) {
//Unexpected service exception.
}
// Retrieve the CSR.
GetCertificateAuthorityCsrResult result = null;
try { | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCertificateAuthorityCsr.md |
7337b62ef686-4 | }
// Retrieve the CSR.
GetCertificateAuthorityCsrResult result = null;
try {
result = client.getCertificateAuthorityCsr(req);
} catch (RequestInProgressException ex) {
throw ex;
} catch (ResourceNotFoundException ex) {
throw ex;
} catch (InvalidArnException ex) {
throw ex;
} catch (RequestFailedException ex) {
throw ex;
}
// Retrieve and display the CSR;
String Csr = result.getCsr();
System.out.println(Csr);
}
}
```
Your output should be similar to the following for the certificate authority \(CA\) that you specify\. The certificate signing request \(CSR\) is base64\-encoded in PEM format\. Save it to a local file, take it to your on\-premises X\.509 infrastructure, and sign it by using your root or a subordinate CA\.
```
-----BEGIN CERTIFICATE REQUEST----- base64-encoded request -----END CERTIFICATE REQUEST-----
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCertificateAuthorityCsr.md |
6fc326bd6909-0 | ACM Private CA does not enforce certain constraints defined in [RFC 5280](https://tools.ietf.org/html/rfc5280)\. The reverse situation is also true: Certain additional constraints appropriate to a private CA are enforced\.
**Enforced**
+ [Not After date](https://tools.ietf.org/html/rfc5280#section-4.1.2.5)\. In conformity with [RFC 5280](https://tools.ietf.org/html/rfc5280), ACM Private CA prevents the issuance of certificates bearing a `Not After` date later than the `Not After` date of the issuing CA's certificate\.
+ [Basic constraints](https://tools.ietf.org/html/rfc5280#section-4.2.1.9)\. ACM Private CA enforces basic constraints and path length in imported CA certificates\.
Basic constraints indicate whether or not the resource identified by the certificate is a CA and can issue certificates\. CA certificates imported to ACM Private CA must include the basic constraints extension, and the extension must be marked `critical`\. In addition to the `critical` flag, `CA=true` must be set\. ACM Private CA enforces basic constraints by failing with a validation exception for the following reasons:
+ The extension is not included in the CA certificate\.
+ The extension is not marked `critical`\.
Path length determines the maximum depth of valid certification paths below the imported CA certificate in the validation chain\. ACM Private CA enforces path length by failing with a validation exception for the following reasons: | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/RFC-compliance.md |
6fc326bd6909-1 | + Importing a CA certificate would violate the path length constraint in the CA certificate or in any CA certificate in the chain\.
+ Issuing a certificate would violate a path length constraint\.
+ [Name constraints](https://tools.ietf.org/html/rfc5280#section-4.2.1.10)\. These constraints on a CA govern what subject names are valid for downstream certificates\. For more information, see [Enforcing Name Constraints on a Private CA](name_constraints.md)\.
**Not enforced**
+ [Policy constraints](https://tools.ietf.org/html/rfc5280#section-4.2.1.11)\. These constraints limit a CA's capacity to issue subordinate CA certificates\.
+ [Subject Key Identifier \(SKI\)](https://tools.ietf.org/html/rfc5280#section-4.2.1.2) and [Authority Key Identifier \(AKI\)](https://tools.ietf.org/html/rfc5280#section-4.2.1.1)\. The RFC requires a CA certificate to contain the SKI extension\. Certificates issued by the CA must contain an AKI extension matching the CA certificate's SKI\. AWS does not enforce these requirements\. If your CA Certificate does not contain an SKI, the issued end\-entity or subordinate CA certificate AKI will be the SHA\-1 hash of the issuer public key instead\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/RFC-compliance.md |
6fc326bd6909-2 | + [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) and [Subject Alternative Name \(SAN\)](https://tools.ietf.org/html/rfc5280#section-4.2.1.6)\. When issuing a certificate, ACM Private CA copies the SubjectPublicKeyInfo and SAN extensions from the provided CSR without performing validation\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/RFC-compliance.md |
d946d0ae6f3c-0 | You can use [AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/) to record API calls that are made by AWS Certificate Manager Private Certificate Authority\. For more information, see the following topics\.
**Topics**
+ [Creating a Certificate Authority](CT-CreateCA.md)
+ [Creating an Audit Report](CT-CreateAuditReport.md)
+ [Deleting a Certificate Authority](CT-DeleteCA.md)
+ [Restoring a Certificate Authority](CT-RestoreCA.md)
+ [Describing a Certificate Authority](CT-DescribeCA.md)
+ [Retrieving a Certificate Authority Certificate](CT-GetCACertificate.md)
+ [Retrieving the Certificate Authority Signing Request](CT-GetCACsr.md)
+ [Retrieving a Certificate](CT-GetCertificate.md)
+ [Importing a Certificate Authority Certificate](CT-ImportCACertificate.md)
+ [Issuing a Certificate](CT-IssueCertificate.md)
+ [Listing Certificate Authorities](CT-ListCAs.md)
+ [Listing Tags](CT-ListTags.md)
+ [Revoking a Certificate](CT-RevokeCertificate.md)
+ [Tagging Private Certificate Authorities](CT-TagPCA.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaCtIntro.md |
d946d0ae6f3c-1 | + [Tagging Private Certificate Authorities](CT-TagPCA.md)
+ [Removing Tags from a Private Certificate Authority](CT-UntagPCA.md)
+ [Updating a Certificate Authority](CT-UpdateCA.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaCtIntro.md |
b95ef7456bf0-0 | The following Java sample shows how to use the [UntagCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html) operation\.
This operation removes one or more tags from your private CA\. A tag consists of a key\-value pair\. If you do not specify the value portion of the tag when calling this operation, the tag is removed regardless of value\. If you specify a value, the tag is removed only if it is associated with the specified value\. To add tags to a private CA, use the [TagCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html) operation\. Call the [ListTags](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListTags.html) operation to see what tags are associated with your CA\.
```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.auth.AWSStaticCredentialsProvider; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-UnTagPCA.md |
b95ef7456bf0-1 | import com.amazonaws.auth.AWSStaticCredentialsProvider;
import java.util.ArrayList;
import com.amazonaws.services.acmpca.AWSACMPCA;
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder;
import com.amazonaws.services.acmpca.model.UntagCertificateAuthorityRequest;
import com.amazonaws.services.acmpca.model.Tag;
import com.amazonaws.AmazonClientException;
import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
import com.amazonaws.services.acmpca.model.InvalidArnException;
import com.amazonaws.services.acmpca.model.InvalidTagException;
public class UntagCertificateAuthority {
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from disk", e);
} | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-UnTagPCA.md |
b95ef7456bf0-2 | } catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from disk", e);
}
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create a Tag object with the tag to delete.
Tag tag = new Tag();
tag.withKey("Administrator");
tag.withValue("Bob");
// Add the tags to a collection.
ArrayList<Tag> tags = new ArrayList<Tag>();
tags.add(tag);
// Create a request object and specify the certificate authority ARN. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-UnTagPCA.md |
b95ef7456bf0-3 | tags.add(tag);
// Create a request object and specify the certificate authority ARN.
UntagCertificateAuthorityRequest req = new UntagCertificateAuthorityRequest();
req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account:" +
"certificate-authority/12345678-1234-1234-1234-123456789012");
req.withTags(tags);
// Delete the tag
try {
client.untagCertificateAuthority(req);
} catch (InvalidArnException ex) {
throw ex;
} catch (ResourceNotFoundException ex) {
throw ex;
} catch (InvalidTagException ex) {
throw ex;
}
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-UnTagPCA.md |
6fac68cf1f5e-0 | You can use [Amazon CloudWatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/) to automate your AWS services and respond automatically to system events such as application availability issues or resource changes\. Events from AWS services are delivered to CloudWatch Events in near\-real time\. You can write simple rules to indicate which events are of interest to you and the automated actions to take when an event matches a rule\. For more information, see [Creating a CloudWatch Events Rule That Triggers on an Event](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/Create-CloudWatch-Events-Rule.html)\.
CloudWatch Events are turned into actions using Amazon EventBridge\. With EventBridge, 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?](https://docs.aws.amazon.com/eventbridge/latest/userguide/what-is-amazon-eventbridge.html) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
f3fb7d8cc994-0 | These events are triggered by the [CreateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) operation\.
**Success**
On success, the operation returns the ARN of the new CA\.
```
{
"version":"0",
"id":"93c0a8a5-3879-ee03-597f-5e2example18",
"detail-type":"ACM Private CA Creation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T19:14:56Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51"
],
"detail":{
"result":"success"
}
}
```
**Failure** | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
f3fb7d8cc994-1 | "result":"success"
}
}
```
**Failure**
On failure, the operation returns an ARN for the CA\. Using the ARN, you can call [DescribeCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthority.html) to determine the status of the CA\.
```
{
"version":"0",
"id":"93c0a8a5-3879-ee03-597f-5e2example18",
"detail-type":"ACM Private CA Creation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T19:14:56Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51"
],
"detail":{
"result":"failure"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
162615636065-0 | These events are triggered by the [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) operation\.
**Success**
On success, the operation returns the ARNs of the CA and of the new certificate\.
```
{
"version":"0",
"id":"dba9ac68-e917-adb7-b5fa-071examplea7",
"detail-type":"ACM Private CA Certificate Issuance",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T19:57:46Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51",
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51/certificate/b845c374b495cbexamplec4c81cc4043" | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
162615636065-1 | ],
"detail":{
"result":"success"
}
}
```
**Failure**
On failure, the operation returns a certificate ARN and the ARN of the CA\. With the certificate ARN, you can call [GetCertificate](https://docs.aws.amazon.com/acm/latest/APIReference/API_GetCertificate.html) to view the reason for the failure\.
```
{
"version":"0",
"id":"dba9ac68-e917-adb7-b5fa-071examplea7",
"detail-type":"ACM Private CA Certificate Issuance",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T19:57:46Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
162615636065-2 | "arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPL51/certificate/b845c374b495cb67dac7ac4c81cc4043"
],
"detail":{
"result":"failure"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
c67883644f46-0 | This event is triggered by the [RevokeCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html) operation\.
No event is sent if the revocation fails or if the certificate has already been revoked\.
****Success****
On success, the operation returns the ARNs of the CA and of the revoked certificate\.
```
{
"version":"0",
"id":"247b9dcb-1f62-b23a-2195-790example7b",
"detail-type":"ACM Private CA Certificate Revocation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-05T20:25:19Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/d87e9a0a-75cb-44ba-bf83-44cEXAMPLE92", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
c67883644f46-1 | "arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/d87e9a0a-75cb-44ba-bf83-44cEXAMPLE92/certificate/d2196bfeef09b5b2088b205EXAMPLEd4"
],
"detail":{
"result":"success"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
a845a3700d9d-0 | These events are triggered by the [RevokeCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html) operation, which should result in the creation of a certificate revocation list \(CRL\)\.
**Success**
On success, the operation returns the ARN of the CA associated with the CRL\.
```
{
"version":"0",
"id":"fefaffcc-9579-8e7b-0565-f11examplead",
"detail-type":"ACM Private CA CRL Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T21:07:08Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:ap-southeast-1:111111111111:certificate-authority/b58e1229-f656-453e-bd11-109EXAMPLE1a"
],
"detail":{
"result":"success"
}
}
```
**Failure 1 – CRL could not be saved to Amazon S3 because of a permission error** | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
a845a3700d9d-1 | }
```
**Failure 1 – CRL could not be saved to Amazon S3 because of a permission error**
Check your Amazon S3 bucket permissions if this error occurs\.
```
{
"version":"0",
"id":"071f4cb1-2a7b-e70c-ab6d-f56example34",
"detail-type":"ACM Private CA CRL Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-07T23:01:25Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/f0192f90-5988-4e90-accc-99dEXAMPLE49"
],
"detail":{
"result":"failure",
"reason":"Failed to write CRL to S3. Check your S3 bucket permissions."
}
}
```
**Failure 2 – CRL could not be saved to Amazon S3 because of an internal error**
Retry the operation if this error occurs\.
```
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
a845a3700d9d-2 | Retry the operation if this error occurs\.
```
{
"version":"0",
"id":"071f4cb1-2a7b-e70c-ab6d-f56example34",
"detail-type":"ACM Private CA CRL Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-07T23:01:25Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/f0192f90-5988-4e90-accc-99dEXAMPLE49"
],
"detail":{
"result":"failure",
"reason":"Failed to write CRL to S3. Internal failure."
}
}
```
**Failure 3 – ACM PCA failed to create a CRL**
To troubleshoot this error, check your [CloudWatch metrics](https://docs.aws.amazon.com/acm-pca/latest/APIReference/PcaCloudWatch.html)\.
```
{
"version":"0", | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
a845a3700d9d-3 | ```
{
"version":"0",
"id":"071f4cb1-2a7b-e70c-ab6d-f56example34",
"detail-type":"ACM Private CA CRL Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-07T23:01:25Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/f0192f90-5988-4e90-accc-99dEXAMPLE49"
],
"detail":{
"result":"failure",
"reason":"Failed to generate CRL. Internal failure."
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
ab21227a3d03-0 | These events are triggered by the [CreateCertificateAuthorityAuditReport](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html) operation\.
**Success**
On success, the operation returns the ARN of the CA and the ID of the audit report\.
```
{
"version":"0",
"id":"f4f561f4-c045-e0a3-cb06-bf7exampled8",
"detail-type":"ACM Private CA Audit Report Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T21:54:20Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPLE51",
"5903194d-0df7-4733-a8a0-cefexampleb9"
],
"detail":{
"result":"success"
}
} | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
ab21227a3d03-1 | ],
"detail":{
"result":"success"
}
}
```
**Failure**
An audit report can fail when ACM PCA lacks PUT permissions on your Amazon S3 bucket, when encryption is enabled on the bucket, or for other reasons\.
```
{
"version":"0",
"id":"f4f561f4-c045-e0a3-cb06-bf7exampled8",
"detail-type":"ACM Private CA Audit Report Generation",
"source":"aws.acm-pca",
"account":"111111111111",
"time":"2019-11-04T21:54:20Z",
"region":"us-east-1",
"resources":[
"arn:aws:acm-pca:us-west-2:111111111111:certificate-authority/d543408e-0f41-4a3f-a0e0-84dEXAMPLE51",
"5903194d-0df7-4733-a8a0-cefexampleb9"
],
"detail":{
"result":"failure"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CloudWatchEvents.md |
3e314dd15ee3-0 | Complete the following procedures to create and install your private CA certificate\. Your CA will then be ready to use\.
ACM Private CA supports three scenarios for installing a CA certificate :
+ Installing a certificate for a root CA hosted by ACM Private CA
+ Installing a subordinate CA certificate whose parent authority is hosted by ACM Private CA
+ Installing a subordinate CA certificate whose parent authority is externally hosted
The following sections describe procedures for each scenario\. The console procedures begin on the console page **Private CAs**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
5eb97f93f2ca-0 | **To create and install a certificate for your private root CA using the console**
1. If you previously created a root CA and chose **Get started** from the **Success** window, you were sent directly to the **Install root CA certificate** wizard\. If you chose to postpone certificate installation, you can open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home) and begin installation by selecting a root CA with status **Pending Certificate** or **Active**, choosing **Actions**, and finally choosing **Install CA Certificate**\. This opens the **Install root CA certificate** wizard\.
1. In the section **Specify the root CA certificate parameters**, specify the following certificate parameters:
+ **Validity** — In years, months, or days, this determines when the CA certificate will expire\. The ACM Private CA default validity period for a root CA certificate is 10 years\.
+ **Signature algorithm** — This specifies the signing algorithm to use when the root CA issues new certificates\.
Choose **Next**\.
1. On the **Review, generate, and install root CA certificate** page, confirm that the configuration is correct and choose **Confirm and install**\. ACM Private CA exports a CSR for your CA, issues a self\-signed root CA certificate using your CA and a root CA template, and then imports the self\-signed root CA certificate\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
5eb97f93f2ca-1 | You should be returned to the **Private CAs** list page, displaying the status of the installation \(success or failure\) at the top\. If the installation was successful, the newly completed root CA displays a status of **Active** in the list\.
**To create and install a certificate for your private root CA using the AWS CLI**
1. Create the root certificate\.
```
aws acm-pca issue-certificate \
--certificate-authority-arn arn:aws:acm-pca:ap-southeast-1:012345678901:certificate-authority/01234567-89ab-cdef-0123-456789abcdef \
--csr file://ca.csr \
--signing-algorithm SHA256WITHRSA \
--template-arn arn:aws:acm-pca:::template/RootCACertificate/V1 \
--validity Value=365,Type=DAYS
```
1. Retrieve the root certificate\.
```
aws acm-pca get-certificate \
--certificate-authority-arn arn:aws:acm-pca:ap-southeast-1:012345678901:certificate-authority/01234567-89ab-cdef-0123-456789abcdef \ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
5eb97f93f2ca-2 | --certificate-arn arn:aws:acm-pca:ap-southeast-1:012345678901:certificate-authority/01234567-89ab-cdef-0123-456789abcdef/certificate/0123456789abcdef0123456789abcdef \
--output text > cert.pem
```
1. Import the root certificate to install it on the CA\.
```
aws acm-pca import-certificate-authority-certificate \
--certificate-authority-arn arn:aws:acm-pca:ap-southeast-1:012345678901:certificate-authority/01234567-89ab-cdef-0123-456789abcdef \
--certificate file://cert.pem
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
fd41a2466803-0 | **To create and install a certificate for your ACM Private CA\-hosted subordinate CA**
1. If you previously created a subordinate CA and chose **Get started** from the **Success\!** window, you were sent directly to the **Install subordinate CA certificate** console\. If you chose to postpone certificate installation, you can open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home) and begin installation by selecting a subordinate CA with status **Pending Certificate** or **Active**, choosing **Actions**, and finally choosing **Install CA Certificate**\. This opens the **Install subordinate CA certificate** wizard\.
1. On the **Private CAs** page, the existing CAs in your account are displayed along with their type and status information\. If a CA is selected that has status **Pending Certificate**, an **Action required** box displays and offers a link to begin installing a certificate\.
Choose **Install a CA certificate**\.
1. On the **Install subordinate CA certificate** page, select the following option:
+ **ACM Private CA** — This installs a certificate managed by ACM Private CA\.
Choose **Next**\.
1. If **ACM Private CA**: In section **Select parent ACM Private CA**, choose an available CA from the **Parent private CA** list\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
fd41a2466803-1 | 1. In the section **Specify the subordinate CA certificate parameters**, can specify the following certificate parameters:
+ **Validity** — In years, months, or days, this determines when the subordinate CA certificate will expire\.
**Note**
The expiration date of the subordinate CA certificate cannot be later than the expiration date of the parent CA certificate\.
+ **Signature algorithm** — This specifies the signing algorithm to use when the subordinate CA issues new certificates\.
+ **Path length** — This specifies the number of trust layers that the subordinate CA may add when signing new certificates\. A path length of zero \(the default\) means that only end\-entity certificates and not CA certificates may be created\. A path length of one or more means that the subordinate CA may issue certificates to create additional CAs subordinate to it\.
+ **Template ARN** — The ARN of the configuration template for this CA certificate\. The template changes if you change the specified **Path length**\. If you create a certificate using the CLI [issue\-certificate](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/issue-certificate.html) command or API [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) action, you must specify the ARN manually\. For information about available CA certificate templates, see [Understanding Certificate Templates](UsingTemplates.md)\.
Choose **Next**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
fd41a2466803-2 | Choose **Next**\.
1. On the **Review and generate** page, confirm that your configuration is correct and choose **Generate**\. ACM Private CA exports a CSR for your CA, issues a CA certificate from the parent CA and template you selected, and imports the CA certificate\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
dbe8ad9f35c8-0 | **To create and install a subordinate CA certificate signed by an external parent CA**
1. If you previously created a subordinate CA and chose **Get started** from the **Success\!** window, you were sent directly to the **Install subordinate CA certificate** console\. If you chose to postpone certificate installation, you can open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home) and begin installation by selecting a subordinate CA with status **Pending Certificate**, choosing **Actions**, and finally choosing **Install CA Certificate**\. This opens the **Install subordinate CA certificate** console\.
1. On the **Install subordinate CA certificate** page, select the following option:
+ **External private CA** — This installs a certificate signed by an external private CA that you own\.
Choose **Next**\.
1. On the **Export a certificate signing request \(CSR\)** page, ACM Private CA generates and displays certificate information and a CSR\. You have to option of exporting the CSR to a file\.
When you have exported the CSR to a file and had the file signed by your external parent CA, choose **Next**\.
1. On the **Import a signed certificate authority \(CA\) certificate** page, import your signed CA certificate and your certificate chain \(containing intermediate certificates\)\.
Choose **Next**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
dbe8ad9f35c8-1 | Choose **Next**\.
1. On the **Review and install** page, confirm that your configuration is correct and choose **Confirm and install**\.
You should be returned to the **Private CAs** list page, displaying the status of the installation \(success or failure\) at the top\. If the installation was successful, the newly completed root CA displays a status of **Active** in the list\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCACertInstall.md |
8410aee71fb4-0 | Before using ACM Private CA, you might need to complete a couple of tasks\.
\(Optional\) In addition, you should determine whether your organization prefers to host its private root CA credentials on premises rather than with AWS\. In that case, you need to set up and secure a self\-managed private PKI before using ACM Private CA\. In this scenario, you then create a subordinate CA in ACM Private CA backed by a parent CA outside of ACM Private CA\. For more information, see [Using a Root Authority Outside ACM Private CA](https://docs.aws.amazon.com/acm-pca/latest/userguide/PCACertInstall.html#InstallSubordinateExternal)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaGettingStarted.md |
7d8ea4db6181-0 | If you're not already an Amazon Web Services \(AWS\) customer, you must sign up to be able to use ACM Private CA\. Your account automatically has access to all available services, but you are charged only for services that you use\. Also, if you are a new AWS customer, some services are available for free during a limited period\. For more information, see [AWS Free Tier](https://aws.amazon.com/free/)\.
**Note**
ACM Private CA is not available in the free tier\.
If you do not have an AWS account, complete the following steps to create one\.
**To sign up for an AWS account**
1. Open [https://portal\.aws\.amazon\.com/billing/signup](https://portal.aws.amazon.com/billing/signup)\.
1. Follow the online instructions\.
Part of the sign\-up procedure involves receiving a phone call and entering a verification code on the phone keypad\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaGettingStarted.md |
1d6e1f707d62-0 | If you have not installed the AWS CLI but want to use it, follow the directions at [AWS Command Line Interface](https://aws.amazon.com/cli/)\. In this guide, we assume you have [configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) your endpoint, region, and authentication details, and we omit these parameters from the sample commands\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaGettingStarted.md |
6b4a0bd3bf1b-0 | Your private CA may fail to create a CRL bucket if Amazon S3 **Block public access \(bucket settings\)** are enforced on your account\. Check your Amazon S3 settings if this occurs\. For more information, see [Using Amazon S3 Block Public Access](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaS3CsrBlock.md |
3fee16b55bcd-0 | Cloud security at AWS is the highest priority\. As an AWS customer, you benefit from data centers and network architectures that are built to meet the requirements of the most security\-sensitive organizations\.
Security is a shared responsibility between AWS and you\. The [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/) describes this as security *of* the cloud and security *in* the cloud:
+ **Security of the cloud** – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud\. AWS also provides you with services that you can use securely\. Third\-party auditors regularly test and verify the effectiveness of our security as part of the [AWS Compliance Programs](http://aws.amazon.com/compliance/programs/)\. To learn about the compliance programs that apply to AWS Certificate Manager Private Certificate Authority, see [AWS Services in Scope by Compliance Program](http://aws.amazon.com/compliance/services-in-scope/)\.
+ **Security in the cloud** – Your responsibility is determined by the AWS service that you use\. You are also responsible for other factors including the sensitivity of your data, your company’s requirements, and applicable laws and regulations\.
This documentation helps you understand how to apply the shared responsibility model when using ACM Private CA\. The following topics show you how to configure ACM Private CA to meet your security and compliance objectives\. You also learn how to use other AWS services that help you to monitor and secure your ACM Private CA resources\.
**Topics** | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/security.md |
3fee16b55bcd-1 | **Topics**
+ [Data Protection in AWS Certificate Manager Private Certificate Authority](data-protection.md)
+ [Identity and Access Management for AWS Certificate Manager Private Certificate Authority](security-iam.md)
+ [Cross\-Account Access to Private CAs](pca-resource-sharing.md)
+ [Logging and Monitoring for AWS Certificate Manager Private Certificate Authority](security-logging-and-monitoring.md)
+ [Compliance Validation for AWS Certificate Manager Private Certificate Authority](security-compliance-validation.md)
+ [Infrastructure Security in AWS Certificate Manager Private Certificate Authority](infrastructure-security.md)
+ [ACM Private CA Best Practices](ca-best-practices.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/security.md |
62e270f1c8ed-0 | 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](http://aws.amazon.com/about-aws/global-infrastructure/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/disaster-recovery-resilience.md |
76a3750027c8-0 | Consider redundancy and DR when planning your CA hierarchy\. ACM Private CA is available in multiple [Regions](https://docs.aws.amazon.com/general/latest/gr/acm-pca.html), which allows you to create redundant CAs in multiple Regions\. The ACM Private CA service operates with a [service level agreement](https://aws.amazon.com/certificate-manager/private-certificate-authority/sla/) \(SLA\) of 99\.9% availability\. There are at least two approaches that you can consider for redundancy and disaster recovery\. You can configure redundancy at the root CA or at the highest subordinate CA\. Each approach has pros and cons\.
1. You can create two root CAs in two different AWS Regions for redundancy and disaster recovery\. With this configuration, each root CA operates independently in an AWS Region, protecting you in the event of a single\-Region disaster\. Creating redundant root CAs does, however, increase operational complexity: You will need to distribute both root CA certificates to the trust stores of browsers and operating systems in your environment\.
1. You can also create two redundant subordinate CAs that chain to the same root CA\. The benefit of this approach is that you need to distribute only a single root CA certificate to the trust stores in your environment\. The limitation is that you don’t have a redundant root CA in the event of a disaster that affects the AWS Region in which your root CA exists\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/disaster-recovery-resilience.md |
ee785d1b4c65-0 | The following CloudTrail example shows the results of a call to the [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) operation\.
```
{
"eventVersion":"1.05",
"userIdentity":{
"type":"IAMUser",
"principalId":"account",
"arn":"arn:aws:iam::account:user/name",
"accountId":"account",
"accessKeyId":"Key_ID"
},
"eventTime":"2018-01-26T22:18:43Z",
"eventSource":"acm-pca.amazonaws.com",
"eventName":"IssueCertificate",
"awsRegion":"us-east-1",
"sourceIPAddress":"xx.xx.xx.xx",
"userAgent":"aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32",
"requestParameters":{ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-IssueCertificate.md |
ee785d1b4c65-1 | "requestParameters":{
"certificateAuthorityArn":"arn:aws:acm-pca:region:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1",
"csr":{
"hb":[
45,
45,
...10
],
"offset":0,
"isReadOnly":false,
"bigEndian":true,
"nativeByteOrder":false,
"mark":-1,
"position":1090,
"limit":1090,
"capacity":1090,
"address":0
},
"signingAlgorithm":"SHA256WITHRSA",
"validity":{
"value":365,
"type":"DAYS"
},
"idempotencyToken":"1234"
},
"responseElements":{ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-IssueCertificate.md |
ee785d1b4c65-2 | },
"idempotencyToken":"1234"
},
"responseElements":{
"certificateArn":"arn:aws:acm-pca:region:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1/certificate/6707447683a9b7f4055627ffd55cebcc"
},
"requestID":"0a5808dd-fc92-46f8-ba07-090ef8e9bcb4",
"eventID":"2816c6f0-184c-4d8b-b4ca-e54ab8dd6f2c",
"eventType":"AwsApiCall",
"recipientAccountId":"account"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-IssueCertificate.md |
6f82fe7cf4c8-0 | 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 Private CA supports the following CloudWatch metrics\.
****
| Metric | Description |
| --- | --- |
| CRLGenerated | A certificate revocation list \(CRL\) was generated\. This metric applies only to a private CA\. |
| MisconfiguredCRLBucket | The S3 bucket specified for the CRL is not correctly configured\. Check the bucket policy\. This metric applies only to a private CA\. |
| Time | This metric specifies the time at which the certificate was issued\. This metric applies only to the IssueCertificate operation\. |
| Success | A certificate was successfully issued\. This metric applies only to the IssueCertificate operation\. |
| Failure | An operation failed\. This metric applies only to the IssueCertificate operation\. |
For more information about CloudWatch metrics, see the following topics:
+ [Using Amazon CloudWatch Metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html)
+ [Creating Amazon CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaCloudWatch.md |
34b623755abe-0 | You can use the AWS Certificate Manager Private Certificate Authority API to programmatically interact with the service by sending HTTP requests\. The service returns HTTP responses\. For more information see [AWS Certificate Manager Private Certificate Authority API Reference](https://docs.aws.amazon.com/acm-pca/latest/APIReference/)\.
In addition to the HTTP API, you can use the AWS SDKs and command line tools to interact with ACM Private CA\. This is recommended over the HTTP API\. For more information, see [Tools for Amazon Web Services](https://aws.amazon.com/tools/)\. The following topics show you how to use the [AWS SDK for Java](https://aws.amazon.com/sdk-for-java/) to program the ACM PCA API\. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaApiIntro.md |
34b623755abe-1 | The [GetCertificateAuthorityCsr](JavaApi-GetCertificateAuthorityCsr.md), [GetCertificate](JavaApi-GetCertificate.md), and [DescribeCertificateAuthorityAuditReport](JavaApi-DescribeCertificateAuthorityAuditReport.md) operations support waiters\. You can use waiters to control the progression of your code based on the presence or state of certain resources\. For more information, see the following topics, as well as [Waiters in the AWS SDK for Java](https://aws.amazon.com/blogs/developer/waiters-in-the-aws-sdk-for-java/) in the [AWS Developer Blog](https://aws.amazon.com/blogs/developer/)\.
**Topics**
+ [Create and Activate a Root CA Programmatically](JavaApi-ActivateRootCA.md)
+ [Create and Activate a Subordinate CA Programmatically](JavaApi-ActivateSubordinateCA.md)
+ [CreateCertificateAuthority](JavaApi-CreatePrivateCertificateAuthority.md)
+ [CreateCertificateAuthorityAuditReport](JavaApi-CreateCertificateAuthorityAuditReport.md)
+ [CreatePermission](JavaApi-CreatePermission.md)
+ [DeleteCertificateAuthority](JavaApi-DeleteCertificateAuthority.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaApiIntro.md |
34b623755abe-2 | + [DeleteCertificateAuthority](JavaApi-DeleteCertificateAuthority.md)
+ [DeletePermission](JavaApi-DeletePermission.md)
+ [DeletePolicy](JavaApi-DeletePolicy.md)
+ [DescribeCertificateAuthority](JavaApi-DescribeCertificateAuthority.md)
+ [DescribeCertificateAuthorityAuditReport](JavaApi-DescribeCertificateAuthorityAuditReport.md)
+ [GetCertificate](JavaApi-GetCertificate.md)
+ [GetCertificateAuthorityCertificate](JavaApi-GetCACertificate.md)
+ [GetCertificateAuthorityCsr](JavaApi-GetCertificateAuthorityCsr.md)
+ [GetPolicy](JavaApi-GetPolicy.md)
+ [ImportCertificateAuthorityCertificate](JavaApi-ImportCertificateAuthorityCertificate.md)
+ [IssueCertificate](JavaApi-IssueCertificate.md)
+ [ListCertificateAuthorities](JavaApi-ListCertificateAuthorities.md)
+ [ListPermissions](JavaApi-ListPermissions.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaApiIntro.md |
34b623755abe-3 | + [ListPermissions](JavaApi-ListPermissions.md)
+ [ListTags](JavaApi-ListTags.md)
+ [PutPolicy](JavaApi-PutPolicy.md)
+ [RestoreCertificateAuthority](JavaApi-RestoreCertificateAuthority.md)
+ [RevokeCertificate](JavaApi-RevokeCertificate.md)
+ [TagCertificateAuthorities](JavaApi-TagPCA.md)
+ [UntagCertificateAuthority](JavaApi-UnTagPCA.md)
+ [UpdateCertificateAuthority](JavaApi-UpdateCertificateAuthority.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaApiIntro.md |
7811aab15d74-0 | The following Java sample shows how to use the [CreateCertificateAuthorityAuditReport](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html) operation\.
The operation creates an audit report that lists every time a certificate is issued or revoked\. The report is saved in the Amazon S3 bucket that you specify on input\. You can generate a new report once every 30 minutes\.
```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.AmazonClientException;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.services.acmpca.AWSACMPCA;
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder;
import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityAuditReportRequest; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreateCertificateAuthorityAuditReport.md |
7811aab15d74-1 | import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityAuditReportRequest;
import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityAuditReportResult;
import com.amazonaws.services.acmpca.model.RequestInProgressException;
import com.amazonaws.services.acmpca.model.RequestFailedException;
import com.amazonaws.services.acmpca.model.InvalidArgsException;
import com.amazonaws.services.acmpca.model.InvalidArnException;
import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
import com.amazonaws.services.acmpca.model.InvalidStateException;
public class CreateCertificateAuthorityAuditReport {
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from file.", e);
}
// Define the endpoint for your sample. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreateCertificateAuthorityAuditReport.md |
7811aab15d74-2 | }
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create a request object and set the certificate authority ARN.
CreateCertificateAuthorityAuditReportRequest req =
new CreateCertificateAuthorityAuditReportRequest();
// Set the certificate authority ARN.
req.setCertificateAuthorityArn("arn:aws:acm-pca:region:account:" +
"certificate-authority/12345678-1234-1234-1234-123456789012");
// Specify the S3 bucket name for your report. | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreateCertificateAuthorityAuditReport.md |
7811aab15d74-3 | // Specify the S3 bucket name for your report.
req.setS3BucketName("your-bucket-name");
// Specify the audit response format.
req.setAuditReportResponseFormat("JSON");
// Create a result object.
CreateCertificateAuthorityAuditReportResult result = null;
try {
result = client.createCertificateAuthorityAuditReport(req);
} catch (RequestInProgressException ex) {
throw ex;
} catch (RequestFailedException ex) {
throw ex;
} catch (ResourceNotFoundException ex) {
throw ex;
} catch (InvalidArnException ex) {
throw ex;
} catch (InvalidArgsException ex) {
throw ex;
} catch (InvalidStateException ex) {
throw ex;
}
String ID = result.getAuditReportId();
String S3Key = result.getS3Key();
System.out.println(ID);
System.out.println(S3Key);
}
}
```
Your output should be similar to the following:
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreateCertificateAuthorityAuditReport.md |
7811aab15d74-4 | }
}
```
Your output should be similar to the following:
```
58904752-7de3-4bdf-ba89-6953e48c3cc7
audit-report/16075838-061c-4f7a-b54b-49bbc111bcff/58904752-7de3-4bdf-ba89-6953e48c3cc7.json
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreateCertificateAuthorityAuditReport.md |
3ed58c1b6bf2-0 | The following Java sample shows how to use the [GetCertificateAuthorityCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCertificate.html) operation\.
This operation retrieves the certificate and certificate chain for your private certificate authority \(CA\)\. Both the certificate and the chain are base64\-encoded strings in PEM format\. The chain does not include the CA certificate\. Each certificate in the chain signs the one before it\.
```
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.services.acmpca.AWSACMPCA;
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder;
import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCertificateRequest;
import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCertificateResult; | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCACertificate.md |
3ed58c1b6bf2-1 | import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCertificateResult;
import com.amazonaws.AmazonClientException;
import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
import com.amazonaws.services.acmpca.model.InvalidStateException;
import com.amazonaws.services.acmpca.model.InvalidArnException;
public class GetCertificateAuthorityCertificate {
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("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load your credentials from disk", e);
}
// Define the endpoint for your sample.
String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2"
String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/";
EndpointConfiguration endpoint = | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCACertificate.md |
3ed58c1b6bf2-2 | EndpointConfiguration endpoint =
new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion);
// Create a client that you can use to make requests.
AWSACMPCA client = AWSACMPCAClientBuilder.standard()
.withEndpointConfiguration(endpoint)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
// Create a request object
GetCertificateAuthorityCertificateRequest req =
new GetCertificateAuthorityCertificateRequest();
// Set the certificate authority ARN,
req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account:" +
"certificate-authority/12345678-1234-1234-1234-123456789012");
// Create a result object.
GetCertificateAuthorityCertificateResult result = null;
try {
result = client.getCertificateAuthorityCertificate(req);
} catch (ResourceNotFoundException ex) {
throw ex;
} catch (InvalidStateException ex) {
throw ex;
} catch (InvalidArnException ex) { | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCACertificate.md |
3ed58c1b6bf2-3 | } catch (InvalidStateException ex) {
throw ex;
} catch (InvalidArnException ex) {
throw ex;
}
// Retrieve and display the certificate information.
String strPcaCert = result.getCertificate();
System.out.println(strPcaCert);
String strPCACChain = result.getCertificateChain();
System.out.println(strPCACChain);
}
}
```
Your output should be a certificate and chain similar to the following for the certificate authority \(CA\) that you specified\.
```
-----BEGIN CERTIFICATE----- base64-encoded certificate -----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- base64-encoded certificate -----END CERTIFICATE-----
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetCACertificate.md |
10609111e5d0-0 | The following CloudTrail example shows the results of a call to the [UntagCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html) operation\.
```
{
"eventVersion":"1.05",
"userIdentity":{
"type":"IAMUser",
"principalId":"account",
"arn":"arn:aws:iam::account:user/namee",
"accountId":"account",
"accessKeyId":"Key_ID"
},
"eventTime":"2018-02-02T00:21:50Z",
"eventSource":"acm-pca.amazonaws.com",
"eventName":"UntagCertificateAuthority",
"awsRegion":"us-east-1",
"sourceIPAddress":"xx.xx.xx.xx",
"userAgent":"aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32",
"requestParameters":{ | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-UntagPCA.md |
10609111e5d0-1 | "requestParameters":{
"certificateAuthorityArn":"arn:aws:acm-pca:us-east-1:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1",
"tags":[
{
"key":"Admin",
"value":"Alice"
}
]
},
"responseElements":null,
"requestID":"b9b385b4-a721-4018-be15-d679ce5c2d6e",
"eventID":"e32c054d-bc19-40a7-bef9-194ed6848a3b",
"eventType":"AwsApiCall",
"recipientAccountId":"account"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-UntagPCA.md |
dc4aa3a8c03a-0 | For the latest AWS terminology, see the [AWS Glossary](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html) in the *AWS General Reference*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/glossary.md |
d028e4b87693-0 | This section provides information about Amazon EventBridge security and authentication\.
**Topics**
+ [Data Protection in Amazon EventBridge](data-protection.md)
+ [Tag\-based Policies](tag-based-policies.md)
+ [Identity and Access Management in Amazon EventBridge](auth-and-access-control-eventbridge.md)
+ [Logging and Monitoring in Amazon EventBridge](logging-cw-api-calls-eventbridge.md)
+ [Resilience in Amazon EventBridge](disaster-recovery-resiliency.md)
Amazon EventBridge uses IAM to control access to other AWS services and resources\. For an overview of how IAM works, see [Overview of Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html) in the *IAM User Guide*\. For an overview of security credentials, see [AWS Security Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) in the *Amazon Web Services General Reference*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/security-eventbridge.md |
1d32704d4dfb-0 | You can run an AWS Lambda function that logs an event whenever an Auto Scaling group launches or terminates an Amazon EC2 instance and whether the launch or terminate event was successful\.
For information about additional EventBridge scenarios using Amazon EC2 Auto Scaling events, see [Getting CloudWatch Events When Your Auto Scaling Group Scales](https://docs.aws.amazon.com/autoscaling/latest/userguide/cloud-watch-events.html) in the *Amazon EC2 Auto Scaling User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
7d5c19fadf32-0 | Create a Lambda function to log the scale\-out and scale\-in events for your Auto Scaling group\. Specify this function when you create your rule\.
**To create a Lambda function**
1. Open the AWS Lambda console at [https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\.
1. If you're new to Lambda, you see a welcome page\. Choose **Get Started Now**\. Otherwise, choose **Create a Lambda function**\.
1. On the **Select blueprint** page, enter `hello` for the filter and choose the **hello\-world** blueprint\.
1. On the **Configure triggers** page, choose **Next**\.
1. On the **Configure function** page, do the following:
1. Enter a name and description for the Lambda function\. For example, name the function `LogAutoScalingEvent`\.
1. Edit the sample code for the Lambda function\. For example:
```
'use strict';
exports.handler = (event, context, callback) => {
console.log('LogAutoScalingEvent');
console.log('Received event:', JSON.stringify(event, null, 2));
callback(null, 'Finished');
};
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
7d5c19fadf32-1 | callback(null, 'Finished');
};
```
1. For **Role**, choose **Choose an existing role**\. For **Existing role**, select your basic execution role\. Otherwise, create a basic execution role\.
1. Choose **Next**\.
1. Choose **Create function**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
5ad68f3c4f4e-0 | Create a rule to run your Lambda function whenever your Auto Scaling group launches or terminates an instance\.
**To create a rule**
1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\.
1. In the navigation pane, choose **Rules**\.
1. Choose **Create rule**\.
1. Enter a name and description for the rule\.
1. For **Define pattern**, do the following:
1. Choose **Event Pattern**\.
1. Choose **Pre\-defined by service**\.
1. For **Service provider**, choose **AWS**\.
1. For **Service Name**, choose **Auto Scaling**\.
1. For **Event type**, choose **Instance Launch and Terminate**\.
1. To capture all successful and unsuccessful instance launch and terminate events, choose **Any instance event**\.
1. By default, the rule matches any Auto Scaling group in the Region\. To make the rule match a specific group, choose **Specific group name\(s\)** and select one or more groups\.
1. By default, the rule matches any Auto Scaling group in the Region\. To make the rule match a specific Auto Scaling group, choose **Specific group name\(s\)** and select one or more Auto Scaling groups\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
5ad68f3c4f4e-1 | 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\.
1. For **Target**, choose **Lambda function**\.
1. For **Function**, select the Lambda function that you created\.
1. Choose **Create**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
43a0f5375880-0 | You can test your rule by manually scaling an Auto Scaling group so that it launches an instance\. After waiting a few minutes for the scale\-out event to occur, verify that your Lambda function was invoked\.
**To test your rule using an Auto Scaling group**
1. To increase the size of your Auto Scaling group, do the following:
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. In the navigation pane, choose **Auto Scaling**, **Auto Scaling Groups**\.
1. Select the check box for your Auto Scaling group\.
1. On the **Details** tab, choose **Edit**\. For **Desired**, increase the desired capacity by one\. For example, if the current value is 2, enter 3\. The desired capacity must be less than or equal to the maximum size of the group\. If your new value for **Desired** is greater than **Max**, you must update **Max**\. When you're finished, choose **Save**\.
1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\.
1. In the navigation pane, choose **Rules**, choose the name of the rule that you created, and choose **Metrics for the rule**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
43a0f5375880-1 | 1. In the navigation pane, choose **Rules**, choose the name of the rule that you created, and choose **Metrics for the rule**\.
1. To view the output from your Lambda function, do the following:
1. Open the CloudWatch console at [https://console\.aws\.amazon\.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)\.
1. In the navigation pane, choose **Logs**\.
1. Select the name of the log group for your Lambda function \(`/aws/lambda/function-name`\)\.
1. Select the name of the log stream to view the data provided by the function for the instance that you launched\.
1. \(Optional\) When you're finished, you can decrease the desired capacity by one so that the Auto Scaling group returns to its previous size\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-as-group-state.md |
5f2d2c4f1755-0 | Amazon EventBridge supports policies based on tags\. For example, you could restrict access to resources that include a tag with the key `environment` and the value `production`\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"events:PutRule",
"events:DescribeRule",
"events:DeleteRule",
"events:CreateEventBus",
"events:DescribeEventBus"
"events:DeleteEventBus"
],
"Resource": "*",
"Condition": {
"StringEquals": {"aws:ResourceTag/environment": "production"}
}
}
]
}
```
This policy will `Deny` the ability to create, delete, or modify tags, rules, or event buses for resources that have been tagged `environment/production`\.
For more information about tagging, see the following\.
+ [Tagging Your Amazon EventBridge Resources](eventbridge-tagging.md)
+ [Controlling Access Using IAM Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/tag-based-policies.md |
412132c958aa-0 | Event patterns have the same structure as the Events they match\. They look much like the events they are filtering\. Rules use event patterns to select events and route them to targets\. A pattern either matches an event or it doesn't\. The following is an example of a simple AWS Event which you might encounter on EventBridge\.
```
{
"version": "0",
"id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "111122223333",
"time": "2017-12-22T18:43:48Z",
"region": "us-west-1",
"resources": [
"arn:aws:ec2:us-west-1:123456789012:instance/ i-1234567890abcdef0"
],
"detail": {
"instance-id": " i-1234567890abcdef0",
"state": "terminated"
}
}
```
Event patterns have the same structure as the events they match\. For example, the following event pattern allows you to subscribe to only events from Amazon EC2\.
```
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
412132c958aa-1 | ```
{
"source": [ "aws.ec2" ]
}
```
The pattern simply quotes the fields you want to match and provides the values you are looking for\.
The sample event above, like most events, has a nested structure\. Suppose you want to process all `instance-termination` events\. Create an event pattern like the following\.
```
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"detail": {
"state": [ "terminated" ]
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
e82fc280ebfe-0 | Only specify fields that you care about\. In the previous example, you only provide values for three fields: The top\-level fields `“source” ` and `“detail-type”`, and the `“state”` field inside the `“detail”` object field\. EventBridge ignores all the other fields in the event while applying the filter\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
d759648c4296-0 | Match values are always in arrays\. Note that the value to match is in a JSON array, surrounded by “\[” and “\]”\. This is so you can provide multiple values\. For example, if you were interested in events from Amazon EC2 or Fargate, you could specify the following\.
```
{
"source": [ "aws.ec2", "aws.fargate" ]
}
```
This matches on events where the value for the `"source"` field is either `"aws.ec2"` or `"aws.fargate"`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
d2c0c1c8e857-0 | You can match on all of the JSON data types\. Consider the following example Amazon EC2 Auto Scaling event\.
```
{
"version": "0",
"id": "3e3c153a-8339-4e30-8c35-687ebef853fe",
"detail-type": "EC2 Instance Launch Successful",
"source": "aws.autoscaling",
"account": "123456789012",
"time": "2015-11-11T21:31:47Z",
"region": "us-east-1",
"resources": [],
"detail": {
"eventVersion": "",
"responseElements": null
}
}
```
For the above example, you can match on the ` “responseElements”` field as follows\.
```
{
"source": [ "aws.autoscaling" ],
"detail-type": [ "EC2 Instance Launch Successful" ],
"detail": {
"responseElements": [ null ]
}
}
```
This works for numbers too\. Consider the following Amazon Macie event \(truncated for brevity\)\.
```
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
d2c0c1c8e857-1 | This works for numbers too\. Consider the following Amazon Macie event \(truncated for brevity\)\.
```
{
"version": "0",
"id": "3e355723-fca9-4de3-9fd7-154c289d6b59",
"detail-type": "Macie Alert",
"source": "aws.macie",
"account": "123456789012",
"time": "2017-04-24T22:28:49Z",
"region": "us-east-1",
"resources": [
"arn:aws:macie:us-east-1:123456789012:trigger/trigger_id/alert/alert_id",
"arn:aws:macie:us-east-1:123456789012:trigger/trigger_id"
],
"detail": {
"notification-type": "ALERT_CREATED",
"name": "Scanning bucket policies",
"tags": [
"Custom_Alert",
"Insider"
],
"url": "https://lb00.us-east-1.macie.aws.amazon.com/111122223333/posts/alert_id", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
d2c0c1c8e857-2 | "alert-arn": "arn:aws:macie:us-east-1:123456789012:trigger/trigger_id/alert/alert_
"risk-score": 80,
"trigger": {
"rule-arn": "arn:aws:macie:us-east-1:123456789012:trigger/trigger_id",
"alert-type": "basic",
"created-at": "2017-01-02 19:54:00.644000",
"description": "Alerting on failed enumeration of large number of bucket policie
"risk": 8
},
"created-at": "2017-04-18T00:21:12.059000",
.
.
.
```
If you want to match anything that has a risk score of 80 and a trigger risk of 8, do the following\.
```
{
"source": ["aws.macie"],
"detail-type": ["Macie Alert"],
"detail": {
"risk-score": [80],
"trigger": {
"risk": [8]
}
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
c2732c43020b-0 | The following example event is used to show how the subsequent event patterns would match with this event JSON\.
```
{
"version": "0",
"id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "111122223333",
"time": "2017-12-22T18:43:48Z",
"region": "us-west-1",
"resources": [
"arn:aws:ec2:us-west-1:123456789012:instance/ i-1234567890abcdef0"
],
"detail": {
"instance-id": " i-1234567890abcdef0",
"state": "terminated"
}
}
```
Event patterns are represented as JSON objects with a structure that is similar to that of events, for example:
```
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"detail": { | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
c2732c43020b-1 | "detail-type": [ "EC2 Instance State-change Notification" ],
"detail": {
"state": [ "running" ]
}
}
```
This event pattern would not match on the example event, as the value of the `"state"` field matches on `"running"`, but the value in the example event is `"terminated"`\.
It is important to remember the following about event pattern matching:
+ For a pattern to match an event, the event must contain all the field names listed in the pattern\. The field names must appear in the event with the same nesting structure\.
+ Other fields of the event not mentioned in the pattern are ignored; effectively, there is a "\*": "\*" wildcard for fields not mentioned\.
+ The matching is exact \(character\-by\-character\), without case\-folding or any other string normalization\.
+ The values being matched follow JSON rules: Strings enclosed in quotes, numbers, and the unquoted keywords `true`, `false`, and `null`\.
+ Number matching is at the string representation level\. For example, 300, 300\.0, and 3\.0e2 are not considered equal\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
c2732c43020b-2 | + Number matching is at the string representation level\. For example, 300, 300\.0, and 3\.0e2 are not considered equal\.
When you write patterns to match events, you can use the `TestEventPattern` API or the `test-event-pattern` CLI command to make sure that your pattern will match the desired events\. For more information, see [TestEventPattern](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_TestEventPattern.html) or [test\-event\-pattern](https://docs.aws.amazon.com/cli/latest/reference/events/test-event-pattern.html)\.
The following event patterns would match the previous example event\. The first pattern matches because one of the instance values specified in the pattern matches the event \(and the pattern does not specify any additional fields not contained in the event\)\. The second one matches because the "terminated" state is contained in the event\.
```
{
"resources": [
"arn:aws:ec2:us-east-1:123456789012:instance/i-12345678",
"arn:aws:ec2:us-east-1:123456789012:instance/i-abcdefgh"
]
}
```
```
{
"detail": {
"state": [ "terminated" ] | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
c2732c43020b-3 | ```
```
{
"detail": {
"state": [ "terminated" ]
}
}
```
These event patterns do not match the event at the top of this page\. The first pattern does not match because the pattern specifies a "pending" value for state, and this value does not appear in the event\. The second pattern does not match because the resource value specified in the pattern does not appear in the event\.
```
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"detail": {
"state": [ "pending" ]
}
}
```
```
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"resources": [ "arn:aws:ec2:us-east-1::image/ami-12345678" ]
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/filtering-examples-structure.md |
007b056ff011-0 | 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](http://aws.amazon.com/about-aws/global-infrastructure/)\.
In addition to the AWS global infrastructure, EventBridge offers several features to help support your data resiliency and backup needs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/disaster-recovery-resiliency.md |
962d32e77a62-0 | The **Input transformer** feature of EventBridge customizes the text from an event before it is passed to the target of a rule\. You can define variables that use JSON path to reference values in the original event source\. You can define multiple variables, assigning each a value from the input\. Then you can use those variables in the *Input Template* as <*variable\-name*>\. The characters "<" and ">" cannot be escaped\.
There are three pre\-defined variables you can use without defining a JSON path\. These variables are reserved, and you cannot create variables with these names\.
+ ****`aws.events.rule-arn` — The Amazon Resource Name \(ARN\) of the EventBridge rule\.
+ ****`aws.events.rule-name` — The Name of the EventBridge rule\.
+ ****`aws.events.event` — A copy of the original event\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/transform-input.md |
0f5e6a205b79-0 | The following is an example Amazon EC2 event\.
```
{
"version": "0",
"id": "7bf73129-1428-4cd3-a780-95db273d1602",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2015-11-11T21:29:54Z",
"region": "us-east-1",
"resources": [
"arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1111"
],
"detail": {
"instance-id": "i-0123456789",
"state": "RUNNING"
}
}
```
When defining a rule in the console, select the **Input Transformer** option under **Configure input**\. This option displays two text boxes: one for the *Input Path* and one for the *Input Template*\.
The *Input Path* is used to define variables\. You use JSON path to reference items in your event and store those values in variables\. For instance, you could create an *Input Path* to reference values in the example event by entering the following in the first text box\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/transform-input.md |
0f5e6a205b79-1 | ```
{
"instance" : "$.detail.instance",
"state" : "$.detail.state"
}
```
This defines two variables, `<instance>` and `<state>`\. You can reference these variables as you create your *Input Template*\.
The *Input Template* is a template for the information you want to pass to your target\. You can create a template that passes either a string or JSON to the target\. Using the previous event and *Input Path*, the following *Input Template* examples will transform the event to the example output before routing it to a target\.
| Description | Template | Output |
| --- | --- | --- |
| Simple string | <pre>"instance <instance> is in <state>"</pre> | <pre>"instance i-0123456789 is in RUNNING"</pre> |
| **String with escaped quotes** | <pre>"instance \"<instance>\" is in <state>"</pre> | <pre>"instance \"i-0123456789\" is in RUNNING"</pre> Note that this is the behavior in the EventBridge console\. The AWS CLI escapes the slash characters and the result is `"instance "i-0123456789" is in RUNNING"`\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/transform-input.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.