Skip to content

Commit

Permalink
Update ResourcePath Pattern to check for staring / (#3019)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Feb 16, 2024
1 parent 8672032 commit 355bbe3
Show file tree
Hide file tree
Showing 31 changed files with 3,168 additions and 1,381 deletions.
11 changes: 11 additions & 0 deletions scripts/update_schemas_manually.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@

patches.extend(
[
ResourcePatch(
resource_type="AWS::ApiGateway::Stage",
patches=[
Patch(
path="/definitions/MethodSetting/properties/ResourcePath",
values={
"pattern": r"^/.*$",
},
),
],
),
ResourcePatch(
resource_type="AWS::ApplicationAutoScaling::ScalingPolicy",
patches=[
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"d0f90a7769ea1d4fa85d0ae3253d825c\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"45b27dc6f4f9a7af15585ca2d23c2646\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"8acebef03922c8bf8153cd9c069d3aab\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"73eb84789e3f47a2ce8a8d0e2a7fa6ca\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2bcfcf6304d65536cc49f5523ab4fb7f\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"bfb34c90ce8436ce9714869ed81302be\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"op": "add",
"path": "/definitions/MethodSetting/properties/ResourcePath/pattern",
"value": "^/.*$"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"type": "boolean"
},
"ResourcePath": {
"pattern": "^/.*$",
"type": "string"
},
"ThrottlingBurstLimit": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"type": "boolean"
},
"ResourcePath": {
"pattern": "^/.*$",
"type": "string"
},
"ThrottlingBurstLimit": {
Expand Down
6 changes: 2 additions & 4 deletions src/cfnlint/data/schemas/providers/ap_southeast_3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
"AWS::EC2::LocalGatewayRoute",
"AWS::OpsWorks::App",
"AWS::Kinesis::Stream",
"AWS::Batch::JobDefinition",
"AWS::IAM::SAMLProvider",
"AWS::CloudFront::KeyGroup",
"AWS::EC2::NetworkInterfaceAttachment",
Expand Down Expand Up @@ -575,7 +574,6 @@
"aws-shield-proactiveengagement.json",
"aws-s3-accessgrantslocation.json",
"aws-guardduty-filter.json",
"aws-ecs-service.json",
"aws-ram-resourceshare.json",
"aws-dms-replicationconfig.json",
"aws-dynamodb-table.json",
Expand All @@ -587,6 +585,7 @@
"aws-ecr-replicationconfiguration.json",
"aws-appconfig-extensionassociation.json",
"aws-ec2-ipampoolcidr.json",
"aws-rds-dbinstance.json",
"aws-ec2-vpcdhcpoptionsassociation.json",
"aws-ec2-networkacl.json",
"aws-lambda-eventsourcemapping.json",
Expand Down Expand Up @@ -793,7 +792,6 @@
"aws-ec2-localgatewayroute.json",
"aws-opsworks-app.json",
"aws-kinesis-stream.json",
"aws-batch-jobdefinition.json",
"aws-iam-samlprovider.json",
"aws-cloudfront-keygroup.json",
"aws-ec2-networkinterfaceattachment.json",
Expand Down Expand Up @@ -854,6 +852,7 @@
"aws-appsync-graphqlschema.json",
"aws-emr-instancefleetconfig.json",
"aws-emr-cluster.json",
"aws-rds-dbcluster.json",
"aws-transfer-agreement.json",
"aws-chatbot-slackchannelconfiguration.json",
"aws-cloudfront-distribution.json",
Expand Down Expand Up @@ -1036,7 +1035,6 @@
"aws-elasticbeanstalk-environment.json",
"aws-cognito-userpoolclient.json",
"aws-lambda-version.json",
"aws-ec2-dhcpoptions.json",
"aws-ec2-ipampool.json",
"aws-iam-servicelinkedrole.json",
"aws-cloudformation-hooktypeconfig.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"type": "boolean"
},
"ResourcePath": {
"pattern": "^/.*$",
"type": "string"
},
"ThrottlingBurstLimit": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"additionalProperties": false,
"createOnlyProperties": [
"/properties/NetbiosNameServers",
"/properties/NetbiosNodeType",
"/properties/NtpServers",
"/properties/DomainName",
"/properties/DomainNameServers"
],
"definitions": {
"Tag": {
"additionalProperties": false,
"properties": {
"Key": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"Value": {
"maxLength": 256,
"minLength": 0,
"type": "string"
}
},
"required": [
"Value",
"Key"
],
"type": "object"
}
},
"description": "Resource Type definition for AWS::EC2::DHCPOptions",
"handlers": {
"create": {
"permissions": [
"ec2:CreateDhcpOptions",
"ec2:DescribeDhcpOptions",
"ec2:CreateTags"
]
},
"delete": {
"permissions": [
"ec2:DeleteDhcpOptions",
"ec2:DeleteTags",
"ec2:DescribeDhcpOptions"
]
},
"list": {
"permissions": [
"ec2:DescribeDhcpOptions"
]
},
"read": {
"permissions": [
"ec2:DescribeDhcpOptions",
"ec2:DescribeTags"
]
},
"update": {
"permissions": [
"ec2:CreateTags",
"ec2:DescribeDhcpOptions",
"ec2:DeleteTags"
]
}
},
"primaryIdentifier": [
"/properties/DhcpOptionsId"
],
"properties": {
"DhcpOptionsId": {
"type": "string"
},
"DomainName": {
"description": "This value is used to complete unqualified DNS hostnames.",
"type": "string"
},
"DomainNameServers": {
"description": "The IPv4 addresses of up to four domain name servers, or AmazonProvidedDNS.",
"items": {
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"NetbiosNameServers": {
"description": "The IPv4 addresses of up to four NetBIOS name servers.",
"items": {
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"NetbiosNodeType": {
"description": "The NetBIOS node type (1, 2, 4, or 8).",
"enum": [
"1",
"2",
"4",
"8"
],
"type": "integer"
},
"NtpServers": {
"description": "The IPv4 addresses of up to four Network Time Protocol (NTP) servers.",
"items": {
"type": "string"
},
"type": "array",
"uniqueItems": false
},
"Tags": {
"description": "Any tags assigned to the DHCP options set.",
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Tag"
},
"type": "array",
"uniqueItems": false
}
},
"readOnlyProperties": [
"/properties/DhcpOptionsId"
],
"tagging": {
"cloudFormationSystemTags": true,
"tagOnCreate": true,
"tagProperty": "/properties/Tags",
"tagUpdatable": true,
"taggable": true
},
"typeName": "AWS::EC2::DHCPOptions"
}
Loading

0 comments on commit 355bbe3

Please sign in to comment.