From 2fc275eb3a2d1eec51be6d01016218dd5e40e47e Mon Sep 17 00:00:00 2001 From: rrigato Date: Sun, 10 Dec 2023 11:20:16 -0600 Subject: [PATCH 1/2] extract cloudfront import details from readme --- README.md | 64 +-------------------------- legacy/resources/cloudfront_import.sh | 40 +++++++++++++++++ 2 files changed, 42 insertions(+), 62 deletions(-) create mode 100644 legacy/resources/cloudfront_import.sh diff --git a/README.md b/README.md index 4f4e6f8..6a7e34e 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ Personal website homepage. - [install script](requirements/git_secrets.sh) -- Adhoc git secrets scan +- Scan before making repo public ``` -git secrets --scan -r . +git secrets --scan-history ``` @@ -52,71 +52,11 @@ and tests static html/webpage configuration -#### devops - -##### images -Repository for images that relate to resources for our code pipeline #### legacy -awscli bash scripts used to import existing resources into -cloudformation templates. - -Since the website implementation was originally created outside of -cloudformation - -[List of resources that can be imported into cloudformation]( - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html - ) ##### Prepare Existing CloudFront for migration -Documenting various one-time setup procedures that -were required when creating a new cloudfront distribution -via cloudformation because cloudformation resource import -does not support cloudfront - -Get the existing CloudFront Distribution config via -the cli: - -``` -aws cloudfront get-distribution-config \ ---id > distribution_config_backup.json -``` - -Lower the default and max ttl (time to live ) json file from the get-distribution-config api call as you prepare to -change the distribution. - -``` -aws cloudfront update-distribution \ ---id \ ---distribution-config file://\ ---if-match -``` - -Get the existing Route53 hosted zone and associated -record sets using the following cli command: - -``` -#hosted zone info -aws route53 get-hosted-zone \ ---id - -#record set info -aws route53 list-resource-record-sets ---hosted-zone-id -``` - -Note that the domain servers associated with your NS -and SOA record sets must match what is listed for the domain -names you own in Route53 "Registered Domains" listing. - -You can create a new hosted zone for a subdomain -Ex: -example.com -test.example.com - -Each having a distinct hosted zone, just the -NS and SOA record sets must match #### logs - directory for python log files diff --git a/legacy/resources/cloudfront_import.sh b/legacy/resources/cloudfront_import.sh new file mode 100644 index 0000000..8964946 --- /dev/null +++ b/legacy/resources/cloudfront_import.sh @@ -0,0 +1,40 @@ +#cloudfront distribution import config + +aws cloudfront get-distribution-config \ +--id > distribution_config_backup.json + + +#Lower the default and max ttl (time to live ) +#json file from the get-distribution-config api call as you prepare to +#change the distribution. + + +aws cloudfront update-distribution \ +--id \ +--distribution-config file://\ +--if-match + +# Get the existing Route53 hosted zone and associated +# record sets using the following cli command: + + +#hosted zone info +aws route53 get-hosted-zone \ +--id + +#record set info +aws route53 list-resource-record-sets +--hosted-zone-id + + +# Note that the domain servers associated with your NS +# and SOA record sets must match what is listed for the domain +# names you own in Route53 "Registered Domains" listing. + +# You can create a new hosted zone for a subdomain +# Ex: +# example.com +# test.example.com + +# Each having a distinct hosted zone, just the +# NS and SOA record sets must match From 3343c325cc5d6e0640a06be0920272647ebdd98b Mon Sep 17 00:00:00 2001 From: rrigato Date: Sun, 10 Dec 2023 11:33:11 -0600 Subject: [PATCH 2/2] remove BuildProdEnvironment stage --- README.md | 14 -------------- templates/code_pipeline.yml | 37 ------------------------------------- 2 files changed, 51 deletions(-) diff --git a/README.md b/README.md index 6a7e34e..8fa9f3f 100644 --- a/README.md +++ b/README.md @@ -51,20 +51,6 @@ and tests static html/webpage configuration - buildspec_prod.yml = Buildspec to use for the prod deployment CodeBuild project - - -#### legacy - -##### Prepare Existing CloudFront for migration - - -#### logs -- directory for python log files - - - - - #### templates diff --git a/templates/code_pipeline.yml b/templates/code_pipeline.yml index 4f2a815..0753cab 100644 --- a/templates/code_pipeline.yml +++ b/templates/code_pipeline.yml @@ -346,43 +346,6 @@ Resources: RunOrder: 1 - - ############################### - #stage 4 Builds the prod - # environment by populating resources created - # in stage 2 - ############################### - - Name: BuildProdEnvironment - Actions: - - Name: Test - ###################################### - #List of valid action type providers - #by action can be found here: - #https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#actions-valid-providers - ###################################### - ActionTypeId: - Category: Test - Owner: AWS - Version: '1' - Provider: CodeBuild - InputArtifacts: - - Name: !GetAtt GitRepo.Name - - Name: BuildDev - OutputArtifacts: - - Name: BuildProd - ######################################### - #Configuration Details by provider can be found here: - #https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#structure-configuration-examples - # - ######################################### - Configuration: - PrimarySource: !GetAtt GitRepo.Name - ProjectName: - !Join ['', ['prod-build-', !Ref ProjectName]] - - RunOrder: 1 - - #################################### #Role that will be assumed when #CodeBuild runs for dev