Skip to content

Commit 8eb871a

Browse files
authored
patch AWS::Cognito::UserPool.UserPollTags spec (#2671)
1 parent 1dfdb40 commit 8eb871a

12 files changed

+101
-9
lines changed

src/cfnlint/data/CloudSpecs/cn-north-1.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2847,8 +2847,9 @@
28472847
},
28482848
"UserPoolTags": {
28492849
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
2850-
"PrimitiveType": "Json",
2850+
"PrimitiveItemType": "String",
28512851
"Required": false,
2852+
"Type": "Map",
28522853
"UpdateType": "Mutable"
28532854
},
28542855
"UsernameAttributes": {

src/cfnlint/data/CloudSpecs/eu-south-1.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3240,8 +3240,9 @@
32403240
},
32413241
"UserPoolTags": {
32423242
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
3243-
"PrimitiveType": "Json",
3243+
"PrimitiveItemType": "String",
32443244
"Required": false,
3245+
"Type": "Map",
32453246
"UpdateType": "Mutable"
32463247
},
32473248
"UsernameAttributes": {

src/cfnlint/data/CloudSpecs/sa-east-1.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5924,8 +5924,9 @@
59245924
},
59255925
"UserPoolTags": {
59265926
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
5927-
"PrimitiveType": "Json",
5927+
"PrimitiveItemType": "String",
59285928
"Required": false,
5929+
"Type": "Map",
59295930
"UpdateType": "Mutable"
59305931
},
59315932
"UsernameAttributes": {

src/cfnlint/data/CloudSpecs/us-east-1.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -150159,8 +150159,9 @@
150159150159
},
150160150160
"UserPoolTags": {
150161150161
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
150162-
"PrimitiveType": "Json",
150162+
"PrimitiveItemType": "String",
150163150163
"Required": false,
150164+
"Type": "Map",
150164150165
"UpdateType": "Mutable"
150165150166
},
150166150167
"UsernameAttributes": {

src/cfnlint/data/ExtendedSpecs/all/01_spec_patch.json

+14
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
"path": "/PropertyTypes/AWS::CloudFront::Distribution.DistributionConfig/Properties/Origins/Required",
2525
"value": true
2626
},
27+
{
28+
"op": "add",
29+
"path": "/ResourceTypes/AWS::Cognito::UserPool/Properties/UserPoolTags/PrimitiveItemType",
30+
"value": "String"
31+
},
32+
{
33+
"op": "remove",
34+
"path": "/ResourceTypes/AWS::Cognito::UserPool/Properties/UserPoolTags/PrimitiveType"
35+
},
36+
{
37+
"op": "add",
38+
"path": "/ResourceTypes/AWS::Cognito::UserPool/Properties/UserPoolTags/Type",
39+
"value": "Map"
40+
},
2741
{
2842
"op": "replace",
2943
"path": "/ResourceTypes/AWS::DynamoDB::Table/Properties/AttributeDefinitions/Required",

src/cfnlint/data/ExtendedSpecs/cn-north-1/07_ssm_service_addition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@
252252
},
253253
"UserPoolTags": {
254254
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
255-
"PrimitiveType": "Json",
255+
"PrimitiveItemType": "String",
256256
"Required": false,
257+
"Type": "Map",
257258
"UpdateType": "Mutable"
258259
},
259260
"UsernameAttributes": {

src/cfnlint/data/ExtendedSpecs/eu-south-1/07_ssm_service_addition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@
252252
},
253253
"UserPoolTags": {
254254
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
255-
"PrimitiveType": "Json",
255+
"PrimitiveItemType": "String",
256256
"Required": false,
257+
"Type": "Map",
257258
"UpdateType": "Mutable"
258259
},
259260
"UsernameAttributes": {

src/cfnlint/data/ExtendedSpecs/sa-east-1/07_ssm_service_addition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,9 @@
13721372
},
13731373
"UserPoolTags": {
13741374
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
1375-
"PrimitiveType": "Json",
1375+
"PrimitiveItemType": "String",
13761376
"Required": false,
1377+
"Type": "Map",
13771378
"UpdateType": "Mutable"
13781379
},
13791380
"UsernameAttributes": {

test/fixtures/specs/us-east-1.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -25095,9 +25095,10 @@
2509525095
},
2509625096
"Properties": {
2509725097
"UserPoolTags": {
25098-
"Required": false,
2509925098
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-userpooltags",
25100-
"PrimitiveType": "Json",
25099+
"PrimitiveItemType": "String",
25100+
"Required": false,
25101+
"Type": "Map",
2510125102
"UpdateType": "Mutable"
2510225103
},
2510325104
"Policies": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
AWSTemplateFormatVersion: 2010-09-09
2+
Resources:
3+
MyCognitoUserPool:
4+
Type: AWS::Cognito::UserPool
5+
Properties:
6+
UserPoolName: userpool
7+
Policies:
8+
PasswordPolicy:
9+
MinimumLength: 8
10+
UsernameAttributes:
11+
- email
12+
Schema:
13+
- AttributeDataType: String
14+
Name: email
15+
Required: false
16+
UserPoolTags:
17+
- Key: Key1
18+
Value: Value1
19+
- Key: Key2
20+
Value: Value2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
AWSTemplateFormatVersion: 2010-09-09
2+
Resources:
3+
MyCognitoUserPool:
4+
Type: AWS::Cognito::UserPool
5+
Properties:
6+
UserPoolName: userpool
7+
Policies:
8+
PasswordPolicy:
9+
MinimumLength: 8
10+
UsernameAttributes:
11+
- email
12+
Schema:
13+
- AttributeDataType: String
14+
Name: email
15+
Required: false
16+
UserPoolTags:
17+
Key1: Value1
18+
Key2: Value2

test/integration/test_good_templates.py

+32
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,38 @@ class TestQuickStartTemplates(BaseCliTestCase):
9090
"results": [],
9191
"exit_code": 0,
9292
},
93+
{
94+
"filename": "test/fixtures/templates/good/resources_cognito_userpool_tag_is_string_map.yaml",
95+
"results": [],
96+
"exit_code": 0,
97+
},
98+
{
99+
"filename": "test/fixtures/templates/bad/resources_cognito_userpool_tag_is_list.yaml",
100+
"results": [
101+
{
102+
"Filename": "test/fixtures/templates/bad/resources_cognito_userpool_tag_is_list.yaml",
103+
"Level": "Error",
104+
"Location": {
105+
"Start": {"ColumnNumber": 7, "LineNumber": 16},
106+
"End": {"ColumnNumber": 19, "LineNumber": 16},
107+
"Path": [
108+
"Resources",
109+
"MyCognitoUserPool",
110+
"Properties",
111+
"UserPoolTags",
112+
],
113+
},
114+
"Message": "Map must be an object of key-value pairs",
115+
"Rule": {
116+
"Description": "Checks resource property values with Primitive Types for values that match those types.",
117+
"Id": "E3012",
118+
"ShortDescription": "Check resource properties values",
119+
"Source": "https://github.com/aws-cloudformation/cfn-python-lint/blob/main/docs/cfn-resource-specification.md#valueprimitivetype",
120+
},
121+
}
122+
],
123+
"exit_code": 2,
124+
},
93125
{
94126
"filename": "test/fixtures/templates/good/transform_serverless_api.yaml",
95127
"results": [],

0 commit comments

Comments
 (0)