# Migrating ECS to the new ARN format for SFCC ### and others --- ## Why? - **tag** resources in ECS clusters - tasks, services, container instances - track costs - so you don't have to do it --- ## How? - servicerocket-tools-staging - servicerocket-tools --- ## Steps 1. `aws ecs put-account-setting-default --name serviceLongArnFormat --value enabled` - taskLongArnFormat - containerInstanceLongArnFormat 2. staging: simply tear down & boot up ECS services & container instances --- ## Most important step 3. production: simply tear down & boot up ECS services & container instances without **DOWNTIME** --- ## How? ```graphviz digraph { compound=true rankdir=RL graph [ fontname="Source Sans Pro", fontsize=20 ]; node [ fontname="Source Sans Pro", fontsize=18]; edge [ fontname="Source Sans Pro", fontsize=12 ]; subgraph core { c [label="new service w/ tasks & container instances"] [shape=oval] } c -> b [ltail=session lhead=session] subgraph cluster1 { concentrate=true a [label="sfcc-production"] [shape=box] b [label="sfcc-production2"] [shape=box] label="SFCC ECS cluster" } } ``` --- ## and then.. ```graphviz digraph { compound=true rankdir=RL graph [ fontname="Source Sans Pro", fontsize=20 ]; node [ fontname="Source Sans Pro", fontsize=18]; edge [ fontname="Source Sans Pro", fontsize=12 ]; subgraph core { c [label="kill once sfcc-production2 is stable"] [shape=oval] } c -> a [ltail=session lhead=session] subgraph cluster1 { concentrate=true a [label="sfcc-production"] [shape=box] b [label="sfcc-production2"] [shape=box] label="SFCC ECS cluster" } } ``` --- ## But... ```graphviz digraph { compound=true rankdir=RL graph [ fontname="Source Sans Pro", fontsize=20 ]; node [ fontname="Source Sans Pro", fontsize=18]; edge [ fontname="Source Sans Pro", fontsize=12 ]; subgraph core { c [label="not the name we want"] [shape=oval] } c -> b [ltail=session lhead=session] subgraph cluster1 { concentrate=true b [label="sfcc-production2"] [shape=box] label="SFCC ECS cluster (new ARN format)" } } ``` --- ## So... ```graphviz digraph { compound=true rankdir=RL graph [ fontname="Source Sans Pro", fontsize=20 ]; node [ fontname="Source Sans Pro", fontsize=18]; edge [ fontname="Source Sans Pro", fontsize=12 ]; subgraph core { c [label="kill once sfcc-production is stable"] [shape=oval] } c -> b [ltail=session lhead=session] subgraph cluster1 { concentrate=true a [label="sfcc-production"] [shape=box] b [label="sfcc-production2"] [shape=box] label="SFCC ECS cluster" } } ``` --- ## Disclaimer - there was some downtime unfortunately (~5 mins) - ASG was stabilizing while changes were being made --- ## Be careful & Thank you ---
{"metaMigratedAt":"2023-06-15T06:38:03.478Z","metaMigratedFrom":"YAML","title":"Migrating ECS to the new ARN format","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"1871c7e5-a757-46f4-a3d5-742faff24553\",\"add\":5597,\"del\":2600}]"}
    540 views