Skip to content

Commit 607a53b

Browse files
authored
Merge pull request #34 from DevOps-Cloud-Team5/SCRUM-92_cf
pass user and pass of db
2 parents ef5be7c + 0dc9828 commit 607a53b

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/workflows/cloudFormation.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
project_name:
77
description: 'Project Name'
88
required: true
9+
db_user:
10+
description: 'User of DB'
11+
required: true
12+
db_password:
13+
description: 'Password of DB'
14+
required: true
915
secret_key:
1016
description: 'Secret Key'
1117
required: true
@@ -69,7 +75,7 @@ jobs:
6975
aws cloudformation deploy \
7076
--template-file ./.github/workflows/stacks/backendStackCF.yaml \
7177
--stack-name ${{ github.event.inputs.project_name }}-backend \
72-
--parameter-overrides ProjectName=${{ github.event.inputs.project_name }} SecretKey=${{ github.event.inputs.secret_key }} EmailHost=${{ github.event.inputs.email_host }} EmailPort=${{ github.event.inputs.email_port }} EmailUser=${{ github.event.inputs.email_user }} EmailPassword=${{ github.event.inputs.email_password }} FrontendUrl=${{ github.event.inputs.frontend_url }}
78+
--parameter-overrides ProjectName=${{ github.event.inputs.project_name }} SecretKey=${{ github.event.inputs.secret_key }} DBUser=${{ db_user }} DBPassword=${{ db_password }} EmailHost=${{ github.event.inputs.email_host }} EmailPort=${{ github.event.inputs.email_port }} EmailUser=${{ github.event.inputs.email_user }} EmailPassword=${{ github.event.inputs.email_password }} FrontendUrl=${{ github.event.inputs.frontend_url }}
7379
--capabilities CAPABILITY_IAM
7480
7581
- name: Setup up Requirements

.github/workflows/stacks/backendStackCF.yaml

+17-8
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,36 @@ Parameters:
77
SecretKey:
88
Type: String
99
Description: Application secret key
10+
DBUser:
11+
Type: String
12+
Description: User of DB
13+
DBPassword:
14+
Type: String
15+
Description: Password of DB
1016
EmailHost:
1117
Type: String
18+
Description: Email host
1219
EmailPort:
1320
Type: Number
21+
Description: Email port
1422
EmailUser:
1523
Type: String
24+
Description: Email username
1625
EmailPassword:
1726
Type: String
27+
Description: Email password
1828
FrontendUrl:
1929
Type: String
2030
Resources:
2131
RDSDatabase:
2232
Type: AWS::RDS::DBInstance
2333
Properties:
24-
# Specify other properties as required for your use case
2534
DBName: !Sub '${ProjectName}-db'
26-
MasterUsername: admin
27-
Engine: postgres # Example, adjust based on your requirements
28-
MasterUserPassword: !Ref DBPassword # This parameter will be auto-generated; see Outputs below
29-
DBInstanceClass: db.t3.micro # Example, adjust based on your requirements
30-
AllocatedStorage: 20 # Example, adjust based on your requirements
35+
MasterUsername: !Ref DBUser
36+
Engine: postgres
37+
MasterUserPassword: !Ref DBPassword
38+
DBInstanceClass: db.t3.micro
39+
AllocatedStorage: 20
3140
Secrets:
3241
Type: AWS::SecretsManager::Secret
3342
Properties:
@@ -39,7 +48,7 @@ Resources:
3948
"DB_NAME": "${RDSDatabase.DBName}",
4049
"DB_HOST": "${RDSDatabase.Endpoint.Address}",
4150
"DB_USER": "${RDSDatabase.MasterUsername}",
42-
"DB_PORT": "5432", # Example, adjust based on your RDS engine
51+
"DB_PORT": "5432",
4352
"DB_PASSWORD": "${RDSDatabase.MasterUserPassword}",
4453
"EMAIL_HOST": "${EmailHost}",
4554
"EMAIL_PORT": "${EmailPort}",
@@ -66,7 +75,7 @@ Resources:
6675
BucketName: !Sub '${ProjectName}-redirect'
6776
WebsiteConfiguration:
6877
RedirectAllRequestsTo:
69-
HostName: "www.example.com"
78+
HostName: "www.attendunce.click"
7079

7180
ZappaBucket:
7281
Type: 'AWS::S3::Bucket'

0 commit comments

Comments
 (0)