1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hello Once you have the PAT, you should store it securely in AWS Secrets Manager.
Use AWS CLI to create a secret:
aws secretsmanager create-secret --name GitHubToken --description "GitHub Personal Access Token" --secret-string "YOUR_GITHUB_TOKEN"
Remember the ARN of the secret you just created, as it will be needed in the CloudFormation template.
Create CloudFormation Template Now you can create a CloudFormation template that provisions the Amplify app:
Resources:
MyAmplifyApp:
Type: "AWS::Amplify::App"
Properties:
Name: MyAppName
Repository: https://github.com/yourusername/yourrepository.git
AccessToken: !Sub
- '{{resolve:secretsmanager:${SecretARN}:SecretString:token}}'
- SecretARN: arn:aws:secretsmanager:region:account-id:secret:GitHubToken-abcdef
OauthToken: !Sub
- '{{resolve:secretsmanager:${SecretARN}:SecretString:token}}'
- SecretARN: arn:aws:secretsmanager:region:account-id:secret:GitHubToken-abcdef
Deploy the CloudFormation Template Now you can deploy the CloudFormation template using the AWS CLI or any CI/CD pipeline you have in place:
aws cloudformation deploy --template-file template.yml --stack-name MyAmplifyStack
After the stack is successfully created, AWS will provision an Amplify app connected to your GitHub repository using the Personal Access Token stored in AWS Secrets Manager.
Regards, Andrii
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
Thanks for the reply. The problem is that I don't have a GitHub token and can't create one. Your answer comes after the problem I need to solve.
If you're not limited to GitHub, you could consider using another source code provider that might not require such tokens for integration. AWS Amplify supports other providers like Bitbucket and AWS CodeCommit. Because without PAT you cannot do anything.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-app.html
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens If you are not able to create a PAT token yourself, contact your Github Administrator