In this document:
-
We refer to a production or non-production domain as the CustomDomain .
We refer to the value of the CustomDomain as$CustomDomain
(e.g.dev.sws.aws.sikt.no
orsws.sikt.no
)/.
For example if$CustomDomain = "dev.sws.aws.sikt.no"
, thenapi.$CustomDomain = "api.dev.sws.aws.sikt.no"
-
If Region is not explicitly mentioned we are always in Region eu-west-1.
-
All AWS Service names appear in italics e.g. (CloudFront).
- The production domain is
sws.sikt.no
. - The non-production domains have the form
<env>.sws.aws.sikt.no
where<env>
is typically "dev", "test", "sandbox". - There is a Route53 Hosted Zone with the property "Domain name" equal to
$CustomDomain
. - There is a Certificate in Certificate Manager in Region us-east-1 that has two records for the domains:
$Domain
(e.g.dev.sws.aws.sikt.no
)*.$Domain
(e.g.*.dev.sws.aws.sikt.no
)
Take a snapshot of the opensearch-clusters and store it somewhere outside of the stack
- Go to CloudFormation -> Stacks, and search for SwsPipeline. Delete the one which is NOT nested
- After this stack has been deleted (can take 20min), still in CloudFormation search for and delete "sws-master-pipeline"
- Go to Route 53 and locate the HostedZone with Domain name equal to
$Domain
. (e.gdev.sws.aws.sikt.no
):- delete any CNAME records that contain the values
api.$Domain
(e.g.,api.dev.aws.sws.sikt.no
) pointing to a cloudfront-url.
- delete any CNAME records that contain the values
- S3 Bucket containing the SWS-Infrastructure files:
Assert that there is an S3 bucket containing the latest version of this repository.
This bucket is maintained manually, and you should pull themaster
branch and copy
the contents of the folder "cloudformation" insearch-workspace-service-infrastucture
repository (as is) to the S3 bucket manually. - Certificates: Assert that a certificate is in place in Certificate Manager in Region us-east-1 and it contains the aforementioned records (see Assumptions)
- Secrets: Set-up the following secrets, if they are not in place:
- Githubtoken
Secret name: githubtoken
Secret key: SecretString
Secret value:<githubtoken>
The values for the non-production environments are shared.
- Githubtoken
Secret name: githubtoken
Secret key: SecretString
- Build Master stack:
- Create a new Master stack using the
pipelines_master_template.yml
from the s3 bucket created earlier. - Fill in the details. The defaults are for dev-environments. The name: sws-master-pipeline
- Create a new Master stack using the
- Update DNS for Backend:
-
Go to ApiGateway --> "Custom domain names" and select the created custom domain name (e.g.
api.sandbox.sws.aws.sikt.no
). -
Copy the value of the field
API Gateway domain name
(e.g.d27gccxh1hqvcd.cloudfront.net
) -
Create a new CNAME Record in the associated Hosted Zone in Route53, e.g.:
Record name: api.sandbox.sws.aws.sikt.no Record type: CNAME Value: d27gccxh1hqvcd.cloudfront.net
-
- Register Snapshot repository
- As the s3 bucket used for the snapshot repo is external out-of-stack resource it should be registered for the Opensearch domain after all resources are created.
- Go to lambda functions: sws-master-pipeline-SwsPi-RegisterSnapshotRepoHand-… (in the code RegisterSnapshotRepoHandler.java)
- Trigger function by clicking “Test” button manually. Make sure return codes are positive (200 returned by Opensearch and lambda)
- Approve build
- Go to Developer Tools > CodePipeline > Pipelines (eu-west-1) and approve deployment