Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
willdavsmith committed Sep 11, 2023
1 parent 72fb390 commit c2d8d2e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
51 changes: 51 additions & 0 deletions reference-apps/eshop/iac/infra/aws.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -33,6 +36,12 @@ resource sqlSubnetGroup 'AWS.RDS/DBSubnetGroup@default' = {
DBSubnetGroupName: sqlSubnetGroupName
DBSubnetGroupDescription: sqlSubnetGroupName
SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds
Tags: [
{
Key: 'RadiusApplication'
Value: application
}
]
}
}

Expand All @@ -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
}
]
}
}

Expand All @@ -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
}
]
}
}

Expand All @@ -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
}
]
}
}

Expand All @@ -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
}
]
}
}

Expand All @@ -134,6 +167,12 @@ resource redisSubnetGroup 'AWS.MemoryDB/SubnetGroup@default' = {
properties: {
SubnetGroupName: redisSubnetGroupName
SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds
Tags: [
{
Key: 'RadiusApplication'
Value: application
}
]
}
}

Expand All @@ -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
}
]
}
}

Expand All @@ -160,6 +205,12 @@ resource basketCache 'AWS.MemoryDB/Cluster@default' = {
SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId]
SubnetGroupName: redisSubnetGroup.name
NumReplicasPerShard: 0
Tags: [
{
Key: 'RadiusApplication'
Value: application
}
]
}
}

Expand Down

0 comments on commit c2d8d2e

Please sign in to comment.