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

Run cfn init to set up LookoutVision Project resource providers #6

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
## My Project
## AWS CloudFormation Resource Providers Lookout for Vision

TODO: Fill this README out!

Be sure to:

* Change the title in this README
* Edit your repository description on GitHub

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
The CloudFormation Resource Provider Package for Amazon Lookout for Vision.

## License

Expand Down
23 changes: 23 additions & 0 deletions aws-lookoutvision-project/.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/
25 changes: 25 additions & 0 deletions aws-lookoutvision-project/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"artifact_type": "RESOURCE",
"typeName": "AWS::LookoutVision::Project",
"language": "java",
"runtime": "java8",
brouwersn marked this conversation as resolved.
Show resolved Hide resolved
"entrypoint": "software.amazon.lookoutvision.project.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.lookoutvision.project.HandlerWrapper::testEntrypoint",
"settings": {
"version": false,
"subparser_name": null,
"verbose": 0,
"force": false,
"type_name": null,
"artifact_type": null,
"namespace": [
"software",
"amazon",
"lookoutvision",
"project"
],
"codegen_template_path": "guided_aws",
"protocolVersion": "2.0.0"
},
"executableEntrypoint": "software.amazon.lookoutvision.project.HandlerWrapperExecutable"
}
14 changes: 14 additions & 0 deletions aws-lookoutvision-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# AWS::LookoutVision::Project

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

This package has two main components:
1. The JSON schema describing an Amazon Lookout for Vision Project, `aws-lookoutvision-project.json`
1. The resource handlers that actually create, delete, update, read, and list Amazon Lookout for Vision Projects.

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.
105 changes: 105 additions & 0 deletions aws-lookoutvision-project/aws-lookoutvision-project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"typeName": "AWS::LookoutVision::Project",
"description": "An example resource schema demonstrating some basic constructs and validation rules.",
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
"definitions": {
"InitechDateFormat": {
"$comment": "Use the `definitions` block to provide shared resource property schemas",
"type": "string",
"format": "date-time"
},
"Memo": {
"type": "object",
"properties": {
"Heading": {
"type": "string"
},
"Body": {
"type": "string"
}
},
"additionalProperties": false
}
},
"properties": {
"TPSCode": {
"description": "A TPS Code is automatically generated on creation and assigned as the unique identifier.",
"type": "string",
"pattern": "^[A-Z]{3,5}[0-9]{8}-[0-9]{4}$"
},
"Title": {
"description": "The title of the TPS report is a mandatory element.",
"type": "string",
"minLength": 20,
"maxLength": 250
},
"CoverSheetIncluded": {
"description": "Required for all TPS Reports submitted after 2/19/1999",
"type": "boolean"
},
"DueDate": {
"$ref": "#/definitions/InitechDateFormat"
},
"ApprovalDate": {
"$ref": "#/definitions/InitechDateFormat"
},
"Memo": {
"$ref": "#/definitions/Memo"
},
"SecondCopyOfMemo": {
"description": "In case you didn't get the first one.",
"$ref": "#/definitions/Memo"
},
"TestCode": {
"type": "string",
"enum": [
"NOT_STARTED",
"CANCELLED"
]
},
"Authors": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"TestCode",
"Title"
],
"readOnlyProperties": [
"/properties/TPSCode"
],
"primaryIdentifier": [
"/properties/TPSCode"
],
"handlers": {
"create": {
"permissions": [
"initech:CreateReport"
]
},
"read": {
"permissions": [
"initech:DescribeReport"
]
},
"update": {
"permissions": [
"initech:UpdateReport"
]
},
"delete": {
"permissions": [
"initech:DeleteReport"
]
},
"list": {
"permissions": [
"initech:ListReports"
]
}
}
}
133 changes: 133 additions & 0 deletions aws-lookoutvision-project/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# AWS::LookoutVision::Project

An example resource schema demonstrating some basic constructs and validation rules.

## Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

### JSON

<pre>
{
"Type" : "AWS::LookoutVision::Project",
"Properties" : {
"<a href="#title" title="Title">Title</a>" : <i>String</i>,
"<a href="#coversheetincluded" title="CoverSheetIncluded">CoverSheetIncluded</a>" : <i>Boolean</i>,
"<a href="#duedate" title="DueDate">DueDate</a>" : <i>String</i>,
"<a href="#approvaldate" title="ApprovalDate">ApprovalDate</a>" : <i>String</i>,
"<a href="#memo" title="Memo">Memo</a>" : <i><a href="memo.md">Memo</a></i>,
"<a href="#secondcopyofmemo" title="SecondCopyOfMemo">SecondCopyOfMemo</a>" : <i><a href="memo.md">Memo</a></i>,
"<a href="#testcode" title="TestCode">TestCode</a>" : <i>String</i>,
"<a href="#authors" title="Authors">Authors</a>" : <i>[ String, ... ]</i>
}
}
</pre>

### YAML

<pre>
Type: AWS::LookoutVision::Project
Properties:
<a href="#title" title="Title">Title</a>: <i>String</i>
<a href="#coversheetincluded" title="CoverSheetIncluded">CoverSheetIncluded</a>: <i>Boolean</i>
<a href="#duedate" title="DueDate">DueDate</a>: <i>String</i>
<a href="#approvaldate" title="ApprovalDate">ApprovalDate</a>: <i>String</i>
<a href="#memo" title="Memo">Memo</a>: <i><a href="memo.md">Memo</a></i>
<a href="#secondcopyofmemo" title="SecondCopyOfMemo">SecondCopyOfMemo</a>: <i><a href="memo.md">Memo</a></i>
<a href="#testcode" title="TestCode">TestCode</a>: <i>String</i>
<a href="#authors" title="Authors">Authors</a>: <i>
- String</i>
</pre>

## Properties

#### Title

The title of the TPS report is a mandatory element.

_Required_: Yes

_Type_: String

_Minimum_: <code>20</code>

_Maximum_: <code>250</code>

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### CoverSheetIncluded

Required for all TPS Reports submitted after 2/19/1999

_Required_: No

_Type_: Boolean

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### DueDate

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### ApprovalDate

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Memo

_Required_: No

_Type_: <a href="memo.md">Memo</a>

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### SecondCopyOfMemo

_Required_: No

_Type_: <a href="memo.md">Memo</a>

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### TestCode

_Required_: Yes

_Type_: String

_Allowed Values_: <code>NOT_STARTED</code> | <code>CANCELLED</code>

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Authors

_Required_: No

_Type_: List of String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return Values

### Ref

When you pass the logical ID of this resource to the intrinsic `Ref` function, Ref returns the TPSCode.

### Fn::GetAtt

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

#### TPSCode

A TPS Code is automatically generated on creation and assigned as the unique identifier.
39 changes: 39 additions & 0 deletions aws-lookoutvision-project/docs/memo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AWS::LookoutVision::Project Memo

## Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

### JSON

<pre>
{
"<a href="#heading" title="Heading">Heading</a>" : <i>String</i>,
"<a href="#body" title="Body">Body</a>" : <i>String</i>
}
</pre>

### YAML

<pre>
<a href="#heading" title="Heading">Heading</a>: <i>String</i>
<a href="#body" title="Body">Body</a>: <i>String</i>
</pre>

## Properties

#### Heading

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Body

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
11 changes: 11 additions & 0 deletions aws-lookoutvision-project/example_inputs/inputs_1_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"TPSCode": "...",
"Title": "...",
"CoverSheetIncluded": "...",
"DueDate": "...",
"ApprovalDate": "...",
"Memo": "...",
"SecondCopyOfMemo": "...",
"TestCode": "...",
"Authors": "..."
}
11 changes: 11 additions & 0 deletions aws-lookoutvision-project/example_inputs/inputs_1_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"TPSCode": "...",
"Title": "...",
"CoverSheetIncluded": "...",
"DueDate": "...",
"ApprovalDate": "...",
"Memo": "...",
"SecondCopyOfMemo": "...",
"TestCode": "...",
"Authors": "..."
}
11 changes: 11 additions & 0 deletions aws-lookoutvision-project/example_inputs/inputs_1_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"TPSCode": "...",
"Title": "...",
"CoverSheetIncluded": "...",
"DueDate": "...",
"ApprovalDate": "...",
"Memo": "...",
"SecondCopyOfMemo": "...",
"TestCode": "...",
"Authors": "..."
}
Loading