Skip to content

Commit d4c2ced

Browse files
author
awstools
committed
feat(client-acm-pca): This release adds support for waiters to fail on AccessDeniedException when having insufficient permissions
1 parent bd7756b commit d4c2ced

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

clients/client-acm-pca/src/waiters/waitForAuditReportCreated.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const checkState = async (
3333
} catch (e) {}
3434
} catch (exception) {
3535
reason = exception;
36+
if (exception.name && exception.name == "AccessDeniedException") {
37+
return { state: WaiterState.FAILURE, reason };
38+
}
3639
}
3740
return { state: WaiterState.RETRY, reason };
3841
};

clients/client-acm-pca/src/waiters/waitForCertificateAuthorityCSRCreated.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const checkState = async (
2121
if (exception.name && exception.name == "RequestInProgressException") {
2222
return { state: WaiterState.RETRY, reason };
2323
}
24+
if (exception.name && exception.name == "AccessDeniedException") {
25+
return { state: WaiterState.FAILURE, reason };
26+
}
2427
}
2528
return { state: WaiterState.RETRY, reason };
2629
};

clients/client-acm-pca/src/waiters/waitForCertificateIssued.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ const checkState = async (client: ACMPCAClient, input: GetCertificateCommandInpu
1515
if (exception.name && exception.name == "RequestInProgressException") {
1616
return { state: WaiterState.RETRY, reason };
1717
}
18+
if (exception.name && exception.name == "AccessDeniedException") {
19+
return { state: WaiterState.FAILURE, reason };
20+
}
1821
}
1922
return { state: WaiterState.RETRY, reason };
2023
};

codegen/sdk-codegen/aws-models/acm-pca.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"sdkId": "ACM PCA",
109109
"arnNamespace": "acm-pca",
110110
"cloudFormationName": "ACMPCA",
111-
"cloudTrailEventSource": "acmpca.amazonaws.com",
111+
"cloudTrailEventSource": "acm-pca.amazonaws.com",
112112
"endpointPrefix": "acm-pca"
113113
},
114114
"aws.auth#sigv4": {
@@ -2360,6 +2360,7 @@
23602360
],
23612361
"traits": {
23622362
"smithy.api#documentation": "<p>Lists information about a specific audit report created by calling the <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html\">CreateCertificateAuthorityAuditReport</a> action. Audit information is created\n\t\t\tevery time the certificate authority (CA) private key is used. The private key is used\n\t\t\twhen you call the <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html\">IssueCertificate</a> action or the\n\t\t\t\t<a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_RevokeCertificate.html\">RevokeCertificate</a> action. </p>",
2363+
"smithy.api#suppress": ["WaitableTraitInvalidErrorType"],
23632364
"smithy.waiters#waitable": {
23642365
"AuditReportCreated": {
23652366
"documentation": "Wait until a Audit Report is created",
@@ -2383,6 +2384,12 @@
23832384
"comparator": "stringEquals"
23842385
}
23852386
}
2387+
},
2388+
{
2389+
"state": "failure",
2390+
"matcher": {
2391+
"errorType": "AccessDeniedException"
2392+
}
23862393
}
23872394
],
23882395
"minDelay": 3
@@ -2735,6 +2742,7 @@
27352742
],
27362743
"traits": {
27372744
"smithy.api#documentation": "<p>Retrieves a certificate from your private CA or one that has been shared with you. The\n\t\t\tARN of the certificate is returned when you call the <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html\">IssueCertificate</a> action. You\n\t\t\tmust specify both the ARN of your private CA and the ARN of the issued certificate when\n\t\t\tcalling the <b>GetCertificate</b> action. You can retrieve the\n\t\t\tcertificate if it is in the <b>ISSUED</b> state. You can call\n\t\t\tthe <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html\">CreateCertificateAuthorityAuditReport</a> action to create a report that\n\t\t\tcontains information about all of the certificates issued and revoked by your private\n\t\t\tCA. </p>",
2745+
"smithy.api#suppress": ["WaitableTraitInvalidErrorType"],
27382746
"smithy.waiters#waitable": {
27392747
"CertificateIssued": {
27402748
"documentation": "Wait until a certificate is issued",
@@ -2750,6 +2758,12 @@
27502758
"matcher": {
27512759
"errorType": "RequestInProgressException"
27522760
}
2761+
},
2762+
{
2763+
"state": "failure",
2764+
"matcher": {
2765+
"errorType": "AccessDeniedException"
2766+
}
27532767
}
27542768
],
27552769
"minDelay": 1
@@ -2842,6 +2856,7 @@
28422856
],
28432857
"traits": {
28442858
"smithy.api#documentation": "<p>Retrieves the certificate signing request (CSR) for your private certificate authority\n\t\t\t(CA). The CSR is created when you call the <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html\">CreateCertificateAuthority</a> action. Sign the CSR with your Amazon Web Services Private CA-hosted\n\t\t\tor on-premises root or subordinate CA. Then import the signed certificate back into\n\t\t\tAmazon Web Services Private CA by calling the <a href=\"https://docs.aws.amazon.com/privateca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html\">ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a\n\t\t\tbase64 PEM-encoded string. </p>",
2859+
"smithy.api#suppress": ["WaitableTraitInvalidErrorType"],
28452860
"smithy.waiters#waitable": {
28462861
"CertificateAuthorityCSRCreated": {
28472862
"documentation": "Wait until a Certificate Authority CSR is created",
@@ -2857,6 +2872,12 @@
28572872
"matcher": {
28582873
"errorType": "RequestInProgressException"
28592874
}
2875+
},
2876+
{
2877+
"state": "failure",
2878+
"matcher": {
2879+
"errorType": "AccessDeniedException"
2880+
}
28602881
}
28612882
],
28622883
"minDelay": 3

0 commit comments

Comments
 (0)