Skip to content

Commit

Permalink
Add json schema for CW Alarm period when in the AWS namespace (#2685)
Browse files Browse the repository at this point in the history
* JSON schema for validating the period on AWS namespaced CW Alarms
* Fix an issue with enum
  • Loading branch information
kddejong committed Jan 17, 2024
1 parent f4866d9 commit 85cfee0
Show file tree
Hide file tree
Showing 119 changed files with 16,812 additions and 1,039 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"f6eaaa3c340fa7ab67533ee1814b5482\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"c202d8c1ce6f4fe56a36f51ce955b757\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"d081b23df0610b29dc969ec7cf411932\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"f99358a13270f02c9ca94ef19c60e982\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"1c80dcec8d6f90a79451390a14786259\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"613fda1a0a47b83d05cf749b15958896\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"52555f79649635e16e7927c400b478bc\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"cfe85805920c1606d5a4a933241a0b3b\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"additionalProperties": true,
"description": "Period < 60 not supported for namespaces with the following prefix: AWS/",
"if": {
"properties": {
"Namespace": {
"pattern": "^AWS/.*$",
"type": "string"
}
}
},
"then": {
"properties": {
"Period": {
"minimum": 60,
"type": [
"number",
"string"
]
}
}
},
"type": "object"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"aws_cloudwatch_alarm/metric_onlyone",
"aws_cloudwatch_alarm/metrics_exclusive",
"aws_cloudwatch_alarm/statistic_exclusive",
"aws_cloudwatch_alarm/thresholdmetric_exclusive"
"aws_cloudwatch_alarm/thresholdmetric_exclusive",
"aws_cloudwatch_alarm/aws_namespace_period"
]
}
]
2 changes: 0 additions & 2 deletions src/cfnlint/data/schemas/providers/af_south_1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"aws-opsworks-elasticloadbalancerattachment.json",
"aws-appmesh-virtualservice.json",
"aws-s3objectlambda-accesspointpolicy.json",
"aws-networkmanager-transitgatewayregistration.json",
"aws-elasticache-replicationgroup.json",
"aws-cloudformation-moduledefaultversion.json",
"aws-sso-permissionset.json",
Expand Down Expand Up @@ -469,7 +468,6 @@
"aws-ssm-association.json",
"aws-ec2-clientvpnendpoint.json",
"aws-cloudfront-responseheaderspolicy.json",
"aws-kms-alias.json",
"aws-route53resolver-resolverrule.json",
"aws-transfer-connector.json",
"aws-appmesh-virtualnode.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
"TargetKeyId"
],
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"tagging": {
"taggable": false
},
"taggable": false,
"typeName": "AWS::KMS::Alias"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@
"create": {
"permissions": [
"networkmanager:RegisterTransitGateway"
],
"timeoutInMinutes": 30
]
},
"delete": {
"permissions": [
"networkmanager:DeregisterTransitGateway"
],
"timeoutInMinutes": 30
]
},
"list": {
"handlerSchema": {
"properties": {
"GlobalNetworkId": {
"$ref": "resource-schema.json#/properties/GlobalNetworkId"
}
},
"required": [
"GlobalNetworkId"
]
},
"permissions": [
"networkmanager:GetTransitGatewayRegistrations"
]
Expand Down
2 changes: 0 additions & 2 deletions src/cfnlint/data/schemas/providers/ap_east_1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"aws-opsworks-elasticloadbalancerattachment.json",
"aws-appmesh-virtualservice.json",
"aws-s3objectlambda-accesspointpolicy.json",
"aws-networkmanager-transitgatewayregistration.json",
"aws-amplify-app.json",
"aws-inspectorv2-filter.json",
"aws-elasticache-replicationgroup.json",
Expand Down Expand Up @@ -519,7 +518,6 @@
"aws-ssm-association.json",
"aws-ec2-clientvpnendpoint.json",
"aws-cloudfront-responseheaderspolicy.json",
"aws-kms-alias.json",
"aws-route53resolver-resolverrule.json",
"aws-transfer-connector.json",
"aws-appmesh-virtualnode.json",
Expand Down
59 changes: 59 additions & 0 deletions src/cfnlint/data/schemas/providers/ap_east_1/aws-kms-alias.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"additionalProperties": false,
"createOnlyProperties": [
"/properties/AliasName"
],
"description": "The AWS::KMS::Alias resource specifies a display name for an AWS KMS key in AWS Key Management Service (AWS KMS). You can use an alias to identify an AWS KMS key in cryptographic operations.",
"handlers": {
"create": {
"permissions": [
"kms:CreateAlias"
]
},
"delete": {
"permissions": [
"kms:DeleteAlias"
]
},
"list": {
"permissions": [
"kms:ListAliases"
]
},
"read": {
"permissions": [
"kms:ListAliases"
]
},
"update": {
"permissions": [
"kms:UpdateAlias"
]
}
},
"primaryIdentifier": [
"/properties/AliasName"
],
"properties": {
"AliasName": {
"description": "Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for AWS managed keys.",
"maxLength": 256,
"minLength": 1,
"pattern": "^(alias/)[a-zA-Z0-9:/_-]+$",
"type": "string"
},
"TargetKeyId": {
"description": "Identifies the AWS KMS key to which the alias refers. Specify the key ID or the Amazon Resource Name (ARN) of the AWS KMS key. You cannot specify another alias. For help finding the key ID and ARN, see Finding the Key ID and ARN in the AWS Key Management Service Developer Guide.",
"maxLength": 256,
"minLength": 1,
"type": "string"
}
},
"required": [
"AliasName",
"TargetKeyId"
],
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"taggable": false,
"typeName": "AWS::KMS::Alias"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@
"create": {
"permissions": [
"networkmanager:RegisterTransitGateway"
],
"timeoutInMinutes": 30
]
},
"delete": {
"permissions": [
"networkmanager:DeregisterTransitGateway"
],
"timeoutInMinutes": 30
]
},
"list": {
"handlerSchema": {
"properties": {
"GlobalNetworkId": {
"$ref": "resource-schema.json#/properties/GlobalNetworkId"
}
},
"required": [
"GlobalNetworkId"
]
},
"permissions": [
"networkmanager:GetTransitGatewayRegistrations"
]
Expand Down
5 changes: 2 additions & 3 deletions src/cfnlint/data/schemas/providers/ap_northeast_1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"aws-ivs-streamkey.json",
"aws-elasticache-securitygroup.json",
"aws-backup-framework.json",
"aws-appflow-connectorprofile.json",
"aws-pinpoint-emailchannel.json",
"aws-rekognition-collection.json",
"aws-opsworks-layer.json",
Expand Down Expand Up @@ -185,6 +184,7 @@
"aws-s3objectlambda-accesspointpolicy.json",
"aws-codegurureviewer-repositoryassociation.json",
"aws-robomaker-simulationapplication.json",
"aws-networkmanager-transitgatewayregistration.json",
"aws-amplify-app.json",
"aws-inspectorv2-filter.json",
"aws-elasticache-replicationgroup.json",
Expand Down Expand Up @@ -296,6 +296,7 @@
"aws-datasync-task.json",
"aws-ecs-taskdefinition.json",
"aws-sagemaker-model.json",
"aws-quicksight-refreshschedule.json",
"aws-memorydb-parametergroup.json",
"aws-robomaker-robotapplicationversion.json",
"aws-appstream-appblock.json",
Expand Down Expand Up @@ -799,13 +800,11 @@
"aws-ec2-clientvpnendpoint.json",
"aws-cloudfront-responseheaderspolicy.json",
"aws-guardduty-master.json",
"aws-kms-alias.json",
"aws-codeguruprofiler-profilinggroup.json",
"aws-route53resolver-resolverrule.json",
"aws-transfer-connector.json",
"aws-appmesh-virtualnode.json",
"aws-apigateway-documentationversion.json",
"aws-licensemanager-grant.json",
"aws-wafv2-webaclassociation.json",
"aws-lookoutmetrics-anomalydetector.json",
"aws-oam-sink.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "string"
},
"AccessToken": {
"maxLength": 4096,
"maxLength": 512,
"pattern": "\\S+",
"type": "string"
},
Expand Down Expand Up @@ -768,7 +768,7 @@
"type": "object"
},
"RefreshToken": {
"maxLength": 2048,
"maxLength": 512,
"pattern": "\\S+",
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"additionalProperties": false,
"createOnlyProperties": [
"/properties/AliasName"
],
"description": "The AWS::KMS::Alias resource specifies a display name for an AWS KMS key in AWS Key Management Service (AWS KMS). You can use an alias to identify an AWS KMS key in cryptographic operations.",
"handlers": {
"create": {
"permissions": [
"kms:CreateAlias"
]
},
"delete": {
"permissions": [
"kms:DeleteAlias"
]
},
"list": {
"permissions": [
"kms:ListAliases"
]
},
"read": {
"permissions": [
"kms:ListAliases"
]
},
"update": {
"permissions": [
"kms:UpdateAlias"
]
}
},
"primaryIdentifier": [
"/properties/AliasName"
],
"properties": {
"AliasName": {
"description": "Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for AWS managed keys.",
"maxLength": 256,
"minLength": 1,
"pattern": "^(alias/)[a-zA-Z0-9:/_-]+$",
"type": "string"
},
"TargetKeyId": {
"description": "Identifies the AWS KMS key to which the alias refers. Specify the key ID or the Amazon Resource Name (ARN) of the AWS KMS key. You cannot specify another alias. For help finding the key ID and ARN, see Finding the Key ID and ARN in the AWS Key Management Service Developer Guide.",
"maxLength": 256,
"minLength": 1,
"type": "string"
}
},
"required": [
"AliasName",
"TargetKeyId"
],
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"taggable": false,
"typeName": "AWS::KMS::Alias"
}
Loading

0 comments on commit 85cfee0

Please sign in to comment.