Bamboo plan for AWS build part 4


Swap URL: This is for blue/green deployment. The idea is to update the floating DNS to point to different stack’s ELB CNAME. It allows us to easily divert the traffics to different backend stack, but keep it transparent to users.

Selection_210.png

Cloudformation snippet

    "Resources": {
        "Route53DNSRecord": {
            "Properties": {
                "Comment": "Floating DNS Record",
                "HostedZoneName": {
                    "Fn::Join": [
                        "",
                        [
                            {
                                "Ref": "MasterHostedZone"
                            },
                            "."
                        ]
                    ]
                },
                "Name": {
                    "Fn::Join": [
                        "",
                        [
                            {
                                "Ref": "Env"
                            },
                            ".",
                            {
                                "Ref": "App"
                            },
                            ".",
                            {
                                "Ref": "MasterHostedZone"
                            },
                            "."
                        ]
                    ]
                },
                "ResourceRecords": [
                    {
                      "Fn::Join": [
                          "",
                          [
                              {
                                  "Ref": "App"
                              },
                              "-",
                              {
                                  "Ref": "Owner"
                              },
							                "-",
                              {
                                  "Ref": "Env"
                              },
                              "-",
                              {
                                  "Ref": "Version"
                              },
                              ".",
                              {
                                  "Ref" : "HostedZone"
                              },
                              "."
                          ]
                      ]
                    }
                ],
                "TTL": "60",
                "Type": "CNAME"
            },
            "Type": "AWS::Route53::RecordSet"
        }
    }

Delete Stack: This is for house keeping. Once you are happy with the new stack, and want to get rid of the old stacks. It is the quickest way – deleting the stacks in Cloudformation. Everything that were created in the Create Stack plan will be removed completely. It keeps the environment clean.

Selection_211.png

Just tell Cloudformation the Stack file name, for instance: ${bamboo.App}-${bamboo.Owner}-${bamboo.Env}-${bamboo.deploy.release}-Stack, just this simple 🙂

Release promotion process should be strictly followed, this will avoid the untested codes to run in production environment.

The codes should be deployed to DEV, then get tested and verified before promoted to UAT. Tests need to be done in UAT before promoting the release in PROD.

Selection_212.png

So far, this is my favourite Bamboo Plan. It supports hot deployment and cold deployment (blue/green deployment).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s