Skip to content

Commit

Permalink
updates to fix issues with prod deploy (most name conflicts since stg…
Browse files Browse the repository at this point in the history
…/prd are in same env)
  • Loading branch information
briri committed Dec 19, 2023
1 parent f3a3588 commit adc98c6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions config/prd/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# provide the name of an existing bucket.
#
template_bucket_name: 'uc3-dmp-hub-cf-bucket-cdluc3prd'

# Stack tags are attached to every AWS resource created by these CloudFormation templates
# with the exception of the Lambda functions and layers which are managed by AWS SAM.
#
Expand Down
1 change: 1 addition & 0 deletions config/prd/global/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ region: 'us-east-1'
sceptre_user_data:
env: 'prd'
domain: 'dmphub.uc3prd.cdlib.net'
hosted_zone: !ssm_parameter /uc3/dmp/hub/prd/HostedZoneId
ssm_path: '/uc3/dmp/hub/prd/'
2 changes: 1 addition & 1 deletion config/prd/regional/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sceptre_user_data:
- !stack_output_external cdl-uc3-prd-defaultsubnet-stack::defaultsubnet2b
- !stack_output_external cdl-uc3-prd-defaultsubnet-stack::defaultsubnet2c

# hosted_zone: !stack_output_external uc3-ops-aws-prd-route53::HostedZoneIdUc3PrdCdlibNet
hosted_zone: !ssm_parameter /uc3/dmp/hub/prd/HostedZoneId

env: 'prd'
domain: 'dmphub.uc3prd.cdlib.net'
Expand Down
2 changes: 1 addition & 1 deletion config/prd/regional/dynamo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ hooks:

# Build and deploy the React based DMP ID Landing Page to the CloudFront S3 bucket
# Args are: environment
- !cmd 'cd ./src/landing_page && ruby build_deply.sh prd'
- !cmd 'cd ./src/landing_page && ruby build_deply.rb prd'
2 changes: 2 additions & 0 deletions initial_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
parser.on("-r", "--region AWS_REGION", "The AWS region (Default: us-west-2)") { |r| @opts[:region] = r }
parser.on("-o", "--override", TrueClass, "Replace existing values") { |o| @opts[:override] = o }

parser.on("-h", "--hosted-zone ZONE", "The HostedZoneId") { |h| @opts[:hosted_zone] = h }
parser.on("-a", "--admin-email EMAIL", "The Administrator email address") { |a| @opts[:email] = a }

parser.on("-x", "--pause-ezid", TrueClass, "Pause EZID submissions") { |o| @opts[:pause_ezid] = o }
Expand Down Expand Up @@ -41,6 +42,7 @@ def put_param(key:, val:, secure: false, override: false)
ezid_doi_base = 'https://doi.org/'
ezid_url = @opts[:env].downcase == 'prd' ? 'https://ezid.cdlib.org/' : 'https://ezid-stg.cdlib.org/'

put_param(key: 'HostedZoneId', val: @opts[:hosted_zone]) unless @opts[:hosted_zone].nil?
put_param(key: 'AdminEmail', val: @opts[:email]) unless @opts[:email].nil?

put_param(key: 'EzidApiUrl', val: ezid_url)
Expand Down
10 changes: 5 additions & 5 deletions src/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Resources:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: 'DMPHub - Read access to the DynamoDB Table'
ManagedPolicyName: 'DmpHubDynamoReadPolicy'
ManagedPolicyName: !Sub 'DmpHub${Env}DynamoReadPolicy'
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand All @@ -124,7 +124,7 @@ Resources:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: 'DMPHub - Write access (and GetItem) to the DynamoDB Table'
ManagedPolicyName: 'DmpHubDynamoWritePolicy'
ManagedPolicyName: !Sub 'DmpHub${Env}DynamoWritePolicy'
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down Expand Up @@ -205,7 +205,7 @@ Resources:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: 'DMPHub - Access to the EventBus'
ManagedPolicyName: 'DmpHubEventBusPolicy'
ManagedPolicyName: !Sub 'DmpHub${Env}EventBusPolicy'
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand All @@ -218,7 +218,7 @@ Resources:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: 'DMPHub - Access to the Cognito User Pool Client'
ManagedPolicyName: 'DmpHubCognitoPolicy'
ManagedPolicyName: !Sub 'DmpHub${Env}CognitoPolicy'
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand All @@ -231,7 +231,7 @@ Resources:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: 'DMPHub - Access to the S3 Bucket'
ManagedPolicyName: 'DmpHubS3Policy'
ManagedPolicyName: !Sub 'DmpHub${Env}S3Policy'
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down

0 comments on commit adc98c6

Please sign in to comment.