Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Deployment guide doesn't show how to replicate a github repo into an s3 location with this? #59

Open
queglay opened this issue Oct 17, 2020 · 4 comments

Comments

@queglay
Copy link

queglay commented Oct 17, 2020

I have read the deployment guide and got the deployment up. But I'm not clear on how to actually get a git repo to be replicated in the bucket from the documentation. what would the next steps be?

I came across this when I encountered the limitation of a cloudformation module referencing modules in an s3 bucket, and since I need to edit those, this seems to be the only way to manage that.

There isn't any instructions on whether the cmmunication uses json or http in the github webhook config, or what to put in the secret form entry.

when I attempt to establish the connection using the url provided by GitPullWebHookApi

I get:

Headers
Content-Length: 37
Content-Type: application/json
Date: Sat, 17 Oct 2020 09:29:51 GMT
Via: 1.1 60e5707b1bd322c0a9qerh35h5h5esh51b57.cloudfront.net (CloudFront)
X-Amz-Apigw-Id: UjHuZEyeCYcFtVg=
X-Amz-Cf-Id: ewZpl_LU2bDTWXutf_yRuDUq0X3w54gw3w5hgw5h-fFUg==
X-Amz-Cf-Pop: SFO20-C1
X-Amzn-Errortype: BadRequestException
X-Amzn-Requestid: 0b1a73b1-8d01-4273-9212-5ed7e33fa448
X-Cache: Error from cloudfront
Body
{"message": "Unsupported Media Type"}

I have added the public ssh key to my github user's accepted ssh keys, so I'm not sure what else I might be missing.

Thanks for any help!

@queglay
Copy link
Author

queglay commented Jun 24, 2021

I got further by testing without using an api secret, and allowing all ip adresses (0.0.0.0/0) to test.

I get this response

Headers
Content-Length: 0
Content-Type: application/json
Date: Thu, 24 Jun 2021 21:33:47 GMT
Via: 1.1 9b097dfab92228268a37145aac5629c1.cloudfront.net (CloudFront)
X-Amz-Apigw-Id: 1l4kkn14l14n=
X-Amz-Cf-Id: 1l43k135ln13lj1n3l1kn414==
X-Amz-Cf-Pop: IAD89-C1
X-Amzn-Requestid: 32kjh235-d470-1l412-bafa-l144l1
X-Amzn-Trace-Id: Root=1-60d4fa3b-73d7403073276ca306853b49;Sampled=0
X-Cache: Miss from cloudfront
Body
{}

But the build event never triggers. I have configured the public key provided to have access to the git repo, and I have configured the web hook with the http url the template provides.

If I try to trigger the build event manually I get this error:

COMMAND_EXECUTION_ERROR: Error while executing command: python3 - << "EOF" from boto3 import client import os s3 = client('s3') kms = client('kms') enckey = s3.get_object(Bucket=os.getenv('KeyBucket'), Key=os.getenv('KeyObject'))['Body'].read() privkey = kms.decrypt(CiphertextBlob=enckey)['Plaintext'] with open('enc_key.pem', 'w') as f: print(privkey.decode("utf-8"), file=f) EOF . Reason: exit status 1

I have tried many times over many months to use this template, but cannot get it to work and would love to figure out why. Any help would be greatly appreciated.

@queglay
Copy link
Author

queglay commented Jun 24, 2021

@queglay
Copy link
Author

queglay commented Jun 24, 2021

Would I be right in guessing this error looks like lambda doesn't have permission to get the required kms key?

@reda-bel
Copy link

I'm getting what seems to be the same error, did you ever figure it out?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants