Skip to content

Commit

Permalink
Added handlers for the resource AWS::IoT::DomainConfiguration (#9)
Browse files Browse the repository at this point in the history
* Adding resource providers for AWS::IoT::DomainConfiguration

* Removed comments

* Fixed minor formatting issues for files

* variable name changes and added serverCertificateArns as createOnly property
  • Loading branch information
ashwinkkumar authored Sep 15, 2020
1 parent 40870c0 commit c17580f
Show file tree
Hide file tree
Showing 22 changed files with 2,077 additions and 0 deletions.
16 changes: 16 additions & 0 deletions aws-iot-domainconfiguration/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"typeName": "AWS::IoT::DomainConfiguration",
"language": "java",
"runtime": "java8",
"entrypoint": "com.amazonaws.iot.domainconfiguration.HandlerWrapper::handleRequest",
"testEntrypoint": "com.amazonaws.iot.domainconfiguration.HandlerWrapper::testEntrypoint",
"settings": {
"namespace": [
"com",
"amazonaws",
"iot",
"domainconfiguration"
],
"protocolVersion": "2.0.0"
}
}
17 changes: 17 additions & 0 deletions aws-iot-domainconfiguration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AWS::IoT::DomainConfiguration

Congratulations on starting development! Next steps:

1. Write the JSON schema describing your resource, `aws-iot-domainconfiguration.json`
2. 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`
3. Implement your resource handlers


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

The code use [Lombok](https://projectlombok.org/), and [you may have to install
IDE integrations](https://projectlombok.org/) to enable auto-complete for
Lombok-annotated classes.
180 changes: 180 additions & 0 deletions aws-iot-domainconfiguration/aws-iot-domainconfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"typeName": "AWS::IoT::DomainConfiguration",
"description": "Create and manage a Domain Configuration",
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"definitions": {
"AuthorizerConfig": {
"type": "object",
"properties": {
"AllowAuthorizerOverride": {
"type": "boolean"
},
"DefaultAuthorizerName": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[\\w=,@-]+$"
}
},
"additionalProperties": false
},
"ServerCertificateSummary": {
"type": "object",
"properties": {
"ServerCertificateArn": {
"type": "string",
"pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$",
"minLength": 1,
"maxLength": 2048
},
"ServerCertificateStatus": {
"type": "string",
"enum": [
"INVALID",
"VALID"
]
},
"ServerCertificateStatusDetail": {
"type": "string"
}
},
"additionalProperties": false
},
"Tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Key": {
"type": "string"
},
"Value": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"Key",
"Value"
]
}
}
},
"properties": {
"DomainConfigurationName": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[\\w.-]+$"
},
"AuthorizerConfig": {
"$ref": "#/definitions/AuthorizerConfig"
},
"DomainName": {
"type": "string",
"minLength": 1,
"maxLength": 253
},
"ServerCertificateArns": {
"type": "array",
"minItems": 0,
"maxItems": 1,
"items": {
"type": "string",
"pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$",
"minLength": 1,
"maxLength": 2048
}
},
"ServiceType": {
"type": "string",
"enum": [
"DATA",
"CREDENTIAL_PROVIDER",
"JOBS"
]
},
"ValidationCertificateArn": {
"type": "string",
"pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$"
},
"Arn": {
"type": "string"
},
"DomainConfigurationStatus": {
"type": "string",
"enum": [
"ENABLED",
"DISABLED"
]
},
"DomainType": {
"type": "string",
"enum": [
"ENDPOINT",
"AWS_MANAGED",
"CUSTOMER_MANAGED"
]
},
"ServerCertificates": {
"type": "array",
"items": {
"$ref": "#/definitions/ServerCertificateSummary"
}
},
"Tags": {
"$ref": "#/definitions/Tags"
}
},
"additionalProperties": false,
"required": [],
"createOnlyProperties": [
"/properties/DomainConfigurationName",
"/properties/DomainName",
"/properties/ServiceType",
"/properties/ValidationCertificateArn",
"/properties/ServerCertificateArns"
],
"readOnlyProperties": [
"/properties/Arn",
"/properties/DomainType",
"/properties/ServerCertificates"
],
"writeOnlyProperties": [
"/properties/ServerCertificateArns"
],
"primaryIdentifier": [
"/properties/DomainConfigurationName"
],
"handlers": {
"create": {
"permissions": [
"iot:CreateDomainConfiguration",
"iot:UpdateDomainConfiguration",
"iot:DescribeDomainConfiguration"
]
},
"read": {
"permissions": [
"iot:DescribeDomainConfiguration"
]
},
"update": {
"permissions": [
"iot:UpdateDomainConfiguration",
"iot:DescribeDomainConfiguration"
]
},
"delete": {
"permissions": [
"iot:DeleteDomainConfiguration",
"iot:UpdateDomainConfiguration"
]
},
"list": {
"permissions": [
"iot:ListDomainConfigurations"
]
}
}
}
1 change: 1 addition & 0 deletions aws-iot-domainconfiguration/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading

0 comments on commit c17580f

Please sign in to comment.