From c2d8d2ea22ee7f33f09404dcecaf016121c3706a Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Mon, 11 Sep 2023 03:43:40 -0700 Subject: [PATCH] progress --- .github/workflows/test.yaml | 10 ++--- reference-apps/eshop/iac/infra/aws.bicep | 51 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ce6eb9ad..0ef65f5f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -312,19 +312,19 @@ jobs: EKS_CLUSTER_NAME: ${{ steps.gen-id.outputs.TEST_EKS_CLUSTER_NAME }} UNIQUE_APP_NAME: ${{ steps.gen-id.outputs.TEST_UNIQUE_APP_NAME }} run: | - # Delete EKS cluster + # Uninstall Radius from EKS cluster rad uninstall kubernetes + # Delete EKS cluster echo "Deleting EKS cluster: $EKS_CLUSTER_NAME" eksctl delete cluster --name $EKS_CLUSTER_NAME --region ${{ env.AWS_REGION }} --wait # Delete AWS resources - # get the arn list of all resources tagged by appname: $UNIQUE_APP_NAME + # get the arn list of all resources tagged by the appname: $UNIQUE_APP_NAME arn_list=$(aws resourcegroupstaggingapi get-resources --tag-filters Key=application,Values=$UNIQUE_APP_NAME --query 'ResourceTagMappingList[*].ResourceARN' --output text) # delete all resources tagged by appname: $UNIQUE_APP_NAME # tag the resource - for arn in $arn_list; do - aws resourcegroupstaggingapi tag-resources --resource-arn-list $arn --tags Key=application,Value=$UNIQUE_APP_NAME - done # get the list of all resources in account + + # list all memorydb clusters - name: Create GitHub issue on failure if: failure() && github.event_name != 'pull_request' run: gh issue create --title "Samples deployment failed for ${{ matrix.app }}" --body "Test failed on ${{ github.repository }}. See [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details." --repo ${{ github.repository }} diff --git a/reference-apps/eshop/iac/infra/aws.bicep b/reference-apps/eshop/iac/infra/aws.bicep index 0c208a99..bf4474ed 100644 --- a/reference-apps/eshop/iac/infra/aws.bicep +++ b/reference-apps/eshop/iac/infra/aws.bicep @@ -7,6 +7,9 @@ param environment string @description('Radius application ID') param application string +@description('Radius application name') +param appname string + @description('SQL administrator username') param adminLogin string @@ -33,6 +36,12 @@ resource sqlSubnetGroup 'AWS.RDS/DBSubnetGroup@default' = { DBSubnetGroupName: sqlSubnetGroupName DBSubnetGroupDescription: sqlSubnetGroupName SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -56,6 +65,12 @@ resource identityDb 'AWS.RDS/DBInstance@default' = { LicenseModel: 'license-included' Timezone: 'GMT Standard Time' CharacterSetName: 'Latin1_General_CI_AS' + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -79,6 +94,12 @@ resource catalogDb 'AWS.RDS/DBInstance@default' = { LicenseModel: 'license-included' Timezone: 'GMT Standard Time' CharacterSetName: 'Latin1_General_CI_AS' + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -102,6 +123,12 @@ resource orderingDb 'AWS.RDS/DBInstance@default' = { LicenseModel: 'license-included' Timezone: 'GMT Standard Time' CharacterSetName: 'Latin1_General_CI_AS' + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -125,6 +152,12 @@ resource webhooksDb 'AWS.RDS/DBInstance@default' = { LicenseModel: 'license-included' Timezone: 'GMT Standard Time' CharacterSetName: 'Latin1_General_CI_AS' + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -134,6 +167,12 @@ resource redisSubnetGroup 'AWS.MemoryDB/SubnetGroup@default' = { properties: { SubnetGroupName: redisSubnetGroupName SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -147,6 +186,12 @@ resource keystoreCache 'AWS.MemoryDB/Cluster@default' = { SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId] SubnetGroupName: redisSubnetGroup.properties.SubnetGroupName NumReplicasPerShard: 0 + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } } @@ -160,6 +205,12 @@ resource basketCache 'AWS.MemoryDB/Cluster@default' = { SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId] SubnetGroupName: redisSubnetGroup.name NumReplicasPerShard: 0 + Tags: [ + { + Key: 'RadiusApplication' + Value: application + } + ] } }