Skip to content

Commit

Permalink
Add tags to AWS Recipes (#47)
Browse files Browse the repository at this point in the history
* Add AWS tags

Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>

* Add environment

Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>

* Add missing tag

Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>

---------

Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
  • Loading branch information
AaronCrawfis authored Nov 9, 2023
1 parent 8132c09 commit 1cab96a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions aws/rediscaches.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ resource subnetGroup 'AWS.MemoryDB/SubnetGroup@default' = {
properties: {
SubnetGroupName: memoryDBSubnetGroupName
SubnetIds: ((empty(subnetIds)) ? eksCluster.properties.ResourcesVpcConfig.SubnetIds : concat(subnetIds,eksCluster.properties.ResourcesVpcConfig.SubnetIds))
Tags: [
{
Key: 'radapp.io/environment'
Value: context.environment.id
}
{
Key: 'radapp.io/application'
Value: context.application.id
}
{
Key: 'radapp.io/resource'
Value: context.resource.id
}
]
}
}

Expand All @@ -63,6 +77,20 @@ resource memoryDBCluster 'AWS.MemoryDB/Cluster@default' = {
SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId]
SubnetGroupName: subnetGroup.name
NumReplicasPerShard: numReplicasPerShard
Tags: [
{
Key: 'radapp.io/environment'
Value: context.environment.id
}
{
Key: 'radapp.io/application'
Value: context.application.id
}
{
Key: 'radapp.io/resource'
Value: context.resource.id
}
]
}
}

Expand Down
28 changes: 28 additions & 0 deletions aws/sqldatabases.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ resource rdsDBSubnetGroup 'AWS.RDS/DBSubnetGroup@default' = {
DBSubnetGroupName: rdsSubnetGroupName
DBSubnetGroupDescription: rdsSubnetGroupName
SubnetIds: eksCluster.properties.ResourcesVpcConfig.SubnetIds
Tags: [
{
Key: 'radapp.io/environment'
Value: context.environment.id
}
{
Key: 'radapp.io/application'
Value: context.application.id
}
{
Key: 'radapp.io/resource'
Value: context.resource.id
}
]
}
}

Expand All @@ -84,6 +98,20 @@ resource rdsDBInstance 'AWS.RDS/DBInstance@default' = {
DBSubnetGroupName: rdsDBSubnetGroup.properties.DBSubnetGroupName
VPCSecurityGroups: [eksCluster.properties.ClusterSecurityGroupId]
LicenseModel: licenseModel
Tags: [
{
Key: 'radapp.io/environment'
Value: context.environment.id
}
{
Key: 'radapp.io/application'
Value: context.application.id
}
{
Key: 'radapp.io/resource'
Value: context.resource.id
}
]
}
}

Expand Down

0 comments on commit 1cab96a

Please sign in to comment.