Skip to content

Commit 4c3b093

Browse files
authored
Merge 2b5859d into a90a439
2 parents a90a439 + 2b5859d commit 4c3b093

3 files changed

Lines changed: 31 additions & 41 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Keyfactor Bootstrap Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, closed, synchronize, edited, reopened]
7+
push:
8+
create:
9+
branches:
10+
- 'release-*.*'
11+
12+
jobs:
13+
call-starter-workflow:
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v2
15+
secrets:
16+
token: ${{ secrets.V2BUILDTOKEN}}
17+
APPROVE_README_PUSH: ${{ secrets.V2BUILDTOKEN }}
18+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
19+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}

.github/workflows/keyfactor-starter-workflow.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

amazon-acmpca-cagateway/Client/ACMPCAClient.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public int RevokeCertificate(RevokeCertificateRequest request)
174174
public List<ACMPCACertificate> GetAuditReport()
175175
{
176176
Logger.MethodEntry(ILogExtensions.MethodLogLevel.Trace);
177+
Logger.Trace($"Creating audit report request with:\n\tCAArn: {Config.CAArn}\n\tS3 Bucket: {Config.S3Bucket}");
177178
CreateCertificateAuthorityAuditReportRequest request = new CreateCertificateAuthorityAuditReportRequest()
178179
{
179180
CertificateAuthorityArn = Config.CAArn,
@@ -201,6 +202,7 @@ public List<ACMPCACertificate> GetAuditReport()
201202
private IAmazonACMPCA GetPCAClient()
202203
{
203204
Logger.MethodEntry(ILogExtensions.MethodLogLevel.Trace);
205+
Logger.Trace($"Creating PCA Client with region {Config.GetRegion()}");
204206
IAmazonACMPCA client = new AmazonACMPCAClient(Config.AccessKey, Config.AccessSecret, Config.GetRegion());
205207
Logger.MethodExit(ILogExtensions.MethodLogLevel.Trace);
206208
return client;
@@ -210,11 +212,21 @@ private IAmazonS3 GetS3Client()
210212
{
211213
Logger.MethodEntry(ILogExtensions.MethodLogLevel.Trace);
212214
string region = "";
215+
Logger.Trace($"Locating region for S3 bucket: {Config.S3Bucket}");
213216
using (IAmazonS3 tempClient = new AmazonS3Client(Config.AccessKey, Config.AccessSecret, Config.GetRegion()))
214217
{
215218
var bucketResponse = tempClient.GetBucketLocation(Config.S3Bucket);
216219
region = bucketResponse.Location.Value;
217220
}
221+
if (string.IsNullOrEmpty(region))
222+
{
223+
region = "us-east-1";
224+
}
225+
if (string.Equals(region, "EU", StringComparison.OrdinalIgnoreCase))
226+
{
227+
region = "eu-west-1";
228+
}
229+
Logger.Trace($"Creating S3 Client with region {region}");
218230
var s3Client = new AmazonS3Client(Config.AccessKey, Config.AccessSecret, RegionEndpoint.GetBySystemName(region));
219231
Logger.MethodExit(ILogExtensions.MethodLogLevel.Trace);
220232
return s3Client;

0 commit comments

Comments
 (0)