Skip to content

Commit

Permalink
Merge pull request #18 from aws-ia/qss3bucketname-fix
Browse files Browse the repository at this point in the history
Fix QSS3BucketName default
  • Loading branch information
vsnyc authored Feb 12, 2024
2 parents 3ba232a + 92d5893 commit 0a04384
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .project_automation/publication/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0
RUN yum install -y yum-utils && yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && yum install -y gh
RUN pip install copier taskcat yq jq awscli cfn-flip
RUN pip install taskcat yq jq awscli
RUN pip3 install 'copier==8.3.0'
RUN pip install 'cfn-lint==0.83.2'
RUN pip install bump2version
21 changes: 1 addition & 20 deletions .project_automation/publication/s3_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,4 @@ aws sts get-caller-identity --debug

chmod 755 ${project_root}/.project_automation/publication/assets/cred_helper.py
# push to regional S3 buckets
export TASKCAT_PROJECT_S3_REGIONAL_BUCKETS=true; taskcat -d upload -p ${project_root} -c "${automation_scripts_path}tmp.yml"

PUBLICATIONS_ASSETS_BUCKET=$(aws ssm get-parameter --region us-east-1 --name PUBLICATIONS_ASSETS_BUCKET --with-decryption | jq -r '.Parameter|.Value')

upload_assets_to_ssm(){
cd ${project_root}
APP_MGR_MANIFEST=${project_root}/manifests/app-manager/app-manager-manifest.yaml
if [[ -f "$APP_MGR_MANIFEST" ]]; then
aws s3 cp --region us-east-1 s3://${PUBLICATIONS_ASSETS_BUCKET}/template_to_ssm_doc_pusher.py ${project_root}/.project_automation/publication/assets/
PUBLISH_SSM_DOC_ACCOUNT_ID=$(aws ssm get-parameter --region us-east-1 --name PUBLISH_SSM_DOC_ACCOUNT_ID --with-decryption | jq -r '.Parameter|.Value')
version_suffix=$(date "+%Y-%m-%d-%H-%M-%S")
regions=$(aws ec2 describe-regions --region us-east-1 --output text | cut -f4)
aws sts get-caller-identity
for region in ${regions}; do
python ${project_root}/.project_automation/publication/assets/template_to_ssm_doc_pusher.py -a ${PUBLISH_SSM_DOC_ACCOUNT_ID} -f ${project_root}/manifests/app-manager/app-manager-manifest.yaml -r ${region} -v ${version_suffix} -d true
done
fi
}

upload_assets_to_ssm
export TASKCAT_PROJECT_S3_REGIONAL_BUCKETS=true; taskcat -d upload -p ${project_root} -c "${automation_scripts_path}tmp.yml"
2 changes: 1 addition & 1 deletion submodules/cfn-ps-aws-vpc
4 changes: 2 additions & 2 deletions templates/main.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Parameters:
uppercase letters, and hyphens, but do not start or end with a hyphen (-).
See https://aws-quickstart.github.io/option1.html.
Type: String
Default: aws-ia-us-east-1
Default: aws-ia
QSS3BucketRegion:
Default: us-east-1
Description: >-
Expand All @@ -256,7 +256,7 @@ Parameters:
Conditions:
UsingDefaultBucket: !Equals
- !Ref QSS3BucketName
- aws-ia-us-east-1
- aws-ia
Resources:
NetworkStack:
Type: 'AWS::CloudFormation::Stack'
Expand Down
2 changes: 1 addition & 1 deletion templates/server.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Parameters:
Conditions:
UsingDefaultBucket: !Equals
- !Ref QSS3BucketName
- aws-ia-us-east-1
- aws-ia
Resources:
RobotIAMRole:
Type: 'AWS::IAM::Role'
Expand Down
4 changes: 2 additions & 2 deletions templates/uipath-robot.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Parameters:
uppercase letters, and hyphens, but do not start or end with a hyphen (-).
See https://aws-quickstart.github.io/option1.html.
Type: String
Default: aws-ia-us-east-1
Default: aws-ia
QSS3BucketRegion:
Default: us-east-1
Description: >-
Expand All @@ -188,7 +188,7 @@ Parameters:
Conditions:
UsingDefaultBucket: !Equals
- !Ref QSS3BucketName
- aws-ia-us-east-1
- aws-ia
Resources:
LambdaRoleStack:
Type: 'AWS::CloudFormation::Stack'
Expand Down

0 comments on commit 0a04384

Please sign in to comment.