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

Initial Commit #4

Merged
merged 17 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from 11 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
23 changes: 23 additions & 0 deletions aws-iotwireless-destination/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# macOS
.DS_Store
._*

# Maven outputs
.classpath

# IntelliJ
*.iml
.idea
out.java
out/
.settings
.project

# auto-generated files
target/

# our logs
rpdk.log

# contains credentials
sam-tests/
8 changes: 8 additions & 0 deletions aws-iotwireless-destination/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
17 changes: 17 additions & 0 deletions aws-iotwireless-destination/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"typeName": "AWS::IoTWireless::Destination",
"language": "java",
"runtime": "java8",
"entrypoint": "software.amazon.iotwireless.destination.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.iotwireless.destination.HandlerWrapper::handleRequest",
"settings": {
"namespace": [
"software",
"amazon",
"iotwireless",
"destination"
],
"codegen_template_path": "guided_aws",
"protocolVersion": "2.0.0"
}
}
12 changes: 12 additions & 0 deletions aws-iotwireless-destination/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AWS::IoTWireless::Destination

Congratulations on starting development! Next steps:

1. Write the JSON schema describing your resource, `aws-iotwireless-destination.json`
1. Implement your resource handlers.

The RPDK will automatically generate the correct resource model from the schema whenever the project is built via Maven. You can also do this manually with the following command: `cfn generate`.

> Please don't modify files under `target/generated-sources/rpdk`, as they will be automatically overwritten.

The code uses [Lombok](https://projectlombok.org/), and [you may have to install IDE integrations](https://projectlombok.org/setup/overview) to enable auto-complete for Lombok-annotated classes.
107 changes: 107 additions & 0 deletions aws-iotwireless-destination/aws-iotwireless-destination.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"typeName": "AWS::IoTWireless::Destination",
"description": "Destination's resource schema demonstrating some basic constructs and validation rules.",
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"definitions": {
"Tag": {
"type": "object",
"properties": {
"Key": {
"type": "string",
"minLength": 1,
"maxLength": 127
},
"Value": {
"type": "string",
"minLength": 1,
"maxLength": 255
}
},
"additionalProperties": false
}
},
"properties": {
"Name": {
"description": "Unique name of destination",
"type": "string",
"pattern": "[a-zA-Z0-9:_-]+",
"maxLength": 128
},
"Expression": {
"description": "Destination expression",
"type": "string"
},
"ExpressionType": {
"description": "Must be RuleName",
"type": "string",
"enum": [
"RuleName",
"ExpressionType"
]
},
"Description": {
"description": "Destination description",
"type": "string",
"maxLength": 2048
},
"Tags": {
"description": "A list of key-value pairs that contain metadata for the destination.",
"type": "array",
"uniqueItems": true,
"maxItems": 50,
"items": {
"$ref": "#/definitions/Tag"
}
},
"RoleArn": {
"description": "AWS role ARN that grants access",
"type": "string",
"minLength": 20,
"maxLength": 2048
},
"Arn": {
"description": "Destination arn. Returned after successful create.",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"Name",
"Expression",
"ExpressionType",
"RoleArn"
],
"readOnlyProperties": [
"/properties/Arn"
],
"primaryIdentifier": [
"/properties/Name"
],
moirahuang marked this conversation as resolved.
Show resolved Hide resolved
"handlers": {
"create": {
"permissions": [
"iotwireless:CreateDestination"
]
},
"read": {
"permissions": [
"iotwireless:GetDestination"
]
},
"update": {
"permissions": [
"iotwireless:UpdateDestination"
]
},
"delete": {
"permissions": [
"iotwireless:DeleteDestination"
]
},
"list": {
"permissions": [
"iotwireless:ListDestinations"
]
}
}
}
6 changes: 6 additions & 0 deletions aws-iotwireless-destination/inputs/inputs_1_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Name": "ContractTest",
"ExpressionType": "RuleName",
"Expression": "rules/ExistingRoleArn/iot/ExistingRoleArnTopic",
"RoleArn": "arn:aws:iam::{{ContractTestExecutionAccountId}}:role/ExistingRoleArn"
}
8 changes: 8 additions & 0 deletions aws-iotwireless-destination/inputs/inputs_1_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Arn": "ContractTest",
"ExpressionType": "RuleName",
"Expression": "rules/ExistingRoleArn/iot/ExistingRoleArnTopic",
"Description": "Test_Description",
"RoleArn": "arn:aws:iam::{{ContractTestExecutionAccountId}}:ExistingRoleArn/AlphaGaTest0role",
"Name": "ContractTest"
}
7 changes: 7 additions & 0 deletions aws-iotwireless-destination/inputs/inputs_1_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Name": "ContractTest",
"ExpressionType": "RuleName",
"Expression": "rules/ExistingRoleArn/iot/ExistingRoleArnTopic",
"Description": "Test_Description",
"RoleArn": "arn:aws:iam::{{ContractTestExecutionAccountId}}:role/ExistingRoleArn"
}
1 change: 1 addition & 0 deletions aws-iotwireless-destination/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading