-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for AWS::IoT::Dimension (#12)
* Add support for AWS::IoT::Dimension * Add improvements for the second revision for Dimension PR * Add improvements for the third revision * Incorporate more feedback * Add more improvements * Use ProgressEvents instead of Cfn exceptions
- Loading branch information
Showing
29 changed files
with
2,041 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# macOS | ||
.DS_Store | ||
._* | ||
|
||
# Maven outputs | ||
.classpath | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea | ||
out.java | ||
out/ | ||
.settings | ||
.project | ||
|
||
# auto-generated files | ||
target/ | ||
.hypothesis/ | ||
|
||
# our logs | ||
rpdk.log | ||
|
||
# contains credentials | ||
sam-tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"typeName": "AWS::IoT::Dimension", | ||
"language": "java", | ||
"runtime": "java8", | ||
"entrypoint": "com.amazonaws.iot.dimension.HandlerWrapper::handleRequest", | ||
"testEntrypoint": "com.amazonaws.iot.dimension.HandlerWrapper::testEntrypoint", | ||
"settings": { | ||
"namespace": [ | ||
"com", | ||
"amazonaws", | ||
"iot", | ||
"dimension" | ||
], | ||
"codegen_template_path": "default", | ||
"protocolVersion": "2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# AWS::IoT::Dimension | ||
|
||
## Running Contract Tests | ||
|
||
You can execute the following commands to run the tests. | ||
You will need to have docker installed and running. | ||
|
||
```bash | ||
# Package the code with Maven | ||
mvn package | ||
# Start SAM which will execute lambdas in Docker | ||
sam local start-lambda | ||
|
||
# In a separate terminal, run the contract tests | ||
cfn test --enforce-timeout 240 | ||
|
||
# Execute a single test | ||
cfn test --enforce-timeout 240 -- -k <testname> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"typeName": "AWS::IoT::Dimension", | ||
"description": "A dimension can be used to limit the scope of a metric used in a security profile for AWS IoT Device Defender.", | ||
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-iot.git", | ||
"definitions": { | ||
"Tag": { | ||
"description": "A key-value pair to associate with a resource.", | ||
"type": "object", | ||
"properties": { | ||
"Key": { | ||
"type": "string", | ||
"description": "The tag's key.", | ||
"minLength": 1, | ||
"maxLength": 128 | ||
}, | ||
"Value": { | ||
"type": "string", | ||
"description": "The tag's value.", | ||
"minLength": 1, | ||
"maxLength": 256 | ||
} | ||
}, | ||
"required": [ | ||
"Value", | ||
"Key" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"properties": { | ||
"Name": { | ||
"description": "A unique identifier for the dimension.", | ||
"type": "string", | ||
"pattern": "[a-zA-Z0-9:_-]+", | ||
"minLength": 1, | ||
"maxLength": 128 | ||
}, | ||
"Type": { | ||
"description": "Specifies the type of the dimension.", | ||
"type": "string", | ||
"enum": [ | ||
"TOPIC_FILTER" | ||
] | ||
}, | ||
"StringValues": { | ||
"description": "Specifies the value or list of values for the dimension.", | ||
"type": "array", | ||
"uniqueItems": true, | ||
"insertionOrder": false, | ||
"items": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 256 | ||
}, | ||
"minItems": 1, | ||
"maxItems": 5 | ||
}, | ||
"Tags": { | ||
"description": "Metadata that can be used to manage the dimension.", | ||
"type": "array", | ||
"maxItems": 50, | ||
"uniqueItems": true, | ||
"insertionOrder": false, | ||
"items": { | ||
"$ref": "#/definitions/Tag" | ||
} | ||
}, | ||
"Arn": { | ||
"description": "The ARN (Amazon resource name) of the created dimension.", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"primaryIdentifier": [ | ||
"/properties/Name" | ||
], | ||
"required": [ | ||
"Type", | ||
"StringValues" | ||
], | ||
"createOnlyProperties": [ | ||
"/properties/Name", | ||
"/properties/Type" | ||
], | ||
"readOnlyProperties": [ | ||
"/properties/Arn" | ||
], | ||
"handlers": { | ||
"create": { | ||
"permissions": [ | ||
"iot:CreateDimension" | ||
] | ||
}, | ||
"read": { | ||
"permissions": [ | ||
"iot:DescribeDimension", | ||
"iot:ListTagsForResource" | ||
] | ||
}, | ||
"update": { | ||
"permissions": [ | ||
"iot:UpdateDimension", | ||
"iot:ListTagsForResource", | ||
"iot:UntagResource", | ||
"iot:TagResource" | ||
] | ||
}, | ||
"delete": { | ||
"permissions": [ | ||
"iot:DescribeDimension", | ||
"iot:DeleteDimension" | ||
] | ||
}, | ||
"list": { | ||
"permissions": [ | ||
"iot:ListDimensions" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"Name": "CfnContractTest", | ||
"StringValues": [ | ||
"device/+/auth" | ||
], | ||
"Type": "TOPIC_FILTER", | ||
"Tags": [ | ||
{ | ||
"Key": "testTagKey", | ||
"Value": "tagValue" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Name": "CfnContractTest-Invalid", | ||
"StringValues": [ | ||
"device/+/auth" | ||
], | ||
"Type": "TOPIC_FILTER", | ||
"Arn": "Arn is a read-only property" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"Name": "CfnContractTest", | ||
"StringValues": [ | ||
"device/+/authV2" | ||
], | ||
"Type": "TOPIC_FILTER", | ||
"Tags": [ | ||
{ | ||
"Key": "cfnTestTagKey2", | ||
"Value": "tagValue2" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lombok.addLombokGeneratedAnnotation = true |
Oops, something went wrong.