Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "graphqlapi:createdBy": "SAM" tag #3254

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions samtranslator/model/sam_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2298,8 +2298,10 @@ def _construct_appsync_api_resources(
self._construct_lambda_auth_connector(api, arn, i) for i, arn in enumerate(lambda_auth_arns, 1)
]

if model.Tags:
api.Tags = get_tag_list(model.Tags)
if not model.Tags:
model.Tags = {}
model.Tags["graphqlapi:createdBy"] = "SAM"
api.Tags = get_tag_list(model.Tags)

# Logging has 3 possible types: dict, bool, and None.
# GraphQLApi will not include logging if and only if the user explicity sets Logging as false boolean.
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_api_cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_api_keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"UserPoolConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SuperCoolAPI"
"Name": "SuperCoolAPI",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SuperDuperCoolAPI"
"Name": "SuperDuperCoolAPI",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_domain_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SomeApi"
"Name": "SomeApi",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SomeApi"
"Name": "SomeApi",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
},
"Name": {
"Ref": "ApiName"
}
},
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_logging_true.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SomeApi"
"Name": "SomeApi",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_no_logging.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-cn/graphqlapi_no_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/output/aws-us-gov/graphqlapi_api_keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"UserPoolConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SuperCoolAPI"
"Name": "SuperCoolAPI",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SuperDuperCoolAPI"
"Name": "SuperDuperCoolAPI",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"Key": "key2",
"Value": "value2"
},
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
],
"XrayEnabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
},
"FieldLogLevel": "ALL"
},
"Name": "SomeApi"
"Name": "SomeApi",
"Tags": [
{
"Key": "graphqlapi:createdBy",
"Value": "SAM"
}
]
},
"Type": "AWS::AppSync::GraphQLApi"
},
Expand Down
Loading