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

Resource implementations for AWS::CloudFormation::ResourceVersion and AWS::CloudFormation::ResourceDefaultVersion #4

Merged
merged 33 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ec5fd3
First pass at a proposed resource schema for AWS::CloudFormation::Type
Nov 20, 2019
5e2c50c
Refactors initial proposal into 2 discrete types
Dec 3, 2019
69c0da9
Updated buildspec with additional type
Dec 11, 2019
b96ed45
Bug fix in CREATE path
Dec 12, 2019
be9473d
Basic CRDL working
Dec 16, 2019
71009a0
Remove pre-existence check from CreateHandler
Dec 16, 2019
545e1ab
CRUDL implemented
Dec 17, 2019
8dfa833
Minor fixes to AWS::CloudFormation::TypeVersion
Dec 17, 2019
3ebf8ea
Fixed schema details
Dec 18, 2019
dc9f5d9
Converting build to Travis
Dec 19, 2019
96b55d5
Fixing python version
Dec 19, 2019
2d3f5fb
Cleanup
Dec 19, 2019
ef2e9e2
Adding build badge
Dec 19, 2019
7146ca7
Renamed types
Dec 20, 2019
97bfb89
Added unit test coverage
Feb 12, 2020
66a1abb
Removed repository information to fix http failures
Feb 25, 2020
85a3fb2
Incorporated required CloudFormation SDK Update
May 18, 2020
34597dd
Reverted to public Java Plugin dependency
May 18, 2020
3223bdc
Converted to CallChain pattern
May 30, 2020
0c76f63
Reworked CallChain implementation and tests
Jun 2, 2020
edc7cf3
Increased cove coverage metric
Jun 2, 2020
32902c4
Implemented AWS::CloudFormation::ResourceDefaultVersion
Jun 2, 2020
105013b
Fixed existing files for pre-commit changes
Jun 2, 2020
5d8c664
Removed commented out block
Jun 19, 2020
bb9b08d
Fixed RegEx error
Jun 19, 2020
ab6cc38
Upgrading to v2.0.0 plugin
Jul 6, 2020
e13eb3e
Various bug fixes - type now works.
Jul 9, 2020
c2c6838
Fixing Java Plugin dependency to 2.0.1
Jul 13, 2020
a4538a4
Extending SAM Local timeout
Jul 22, 2020
44b576e
Fixing DeleteHandler implementation to not return model
Jul 22, 2020
2f5d1cc
Fixed dependency version
Jul 23, 2020
ab01ee9
Fixing dependency
Jul 23, 2020
b537187
Updated AWS::CloudFormation::ResourceDefaultVersion
Jul 24, 2020
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ hs_err_pid*
# IDE configurations
*.iml
.vscode/
.idea/

# Build
target/
Expand All @@ -34,3 +35,4 @@ target/
.factorypath
.project
.settings/
.hypothesis/
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
rev: v2.4.0
hooks:
- id: check-case-conflict
- id: detect-private-key
Expand All @@ -12,6 +12,7 @@ repos:
- id: pretty-format-json
args:
- --autofix
- --indent=4
- --indent=2
- --no-sort-keys
- id: check-merge-conflict
- id: check-yaml
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ install:
- pip3 install --user pre-commit cloudformation-cli-java-plugin
script:
- pre-commit run --all-files --verbose
- cd "$TRAVIS_BUILD_DIR/aws-cloudformation-resourcedefaultversion"
# from Maven 3.6.1+, should use `--no-transfer-progress` instead of Slf4jMavenTransferListener
- >
mvn
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-B
clean verify
- cd "$TRAVIS_BUILD_DIR/aws-cloudformation-resourceversion"
# from Maven 3.6.1+, should use `--no-transfer-progress` instead of Slf4jMavenTransferListener
- >
mvn
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-B
clean verify
Comment on lines +13 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have something like this?

jobs:
  include:
    - script: |
        for directory in $TRAVIS_BUILD_DIR/aws-*; do
          cd "$directory"
          mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean verify || travis_terminate 1
        done

Copy link

@miparnisari miparnisari Sep 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- cd "$TRAVIS_BUILD_DIR/aws-cloudformation-stackset"
# from Maven 3.6.1+, should use `--no-transfer-progress` instead of Slf4jMavenTransferListener
- >
Expand All @@ -18,4 +32,6 @@ script:
-B
clean verify
after_failure:
- cat "$TRAVIS_BUILD_DIR/aws-cloudformation-resourcedefaultversion/rpdk.log"
- cat "$TRAVIS_BUILD_DIR/aws-cloudformation-resourceversion/rpdk.log"
- cat "$TRAVIS_BUILD_DIR/aws-cloudformation-stackset/rpdk.log"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This repository contains AWS-owned resource providers for the `AWS::CloudFormation::*` namespace.

[![Build Status](https://travis-ci.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation.svg?branch=master)](https://travis-ci.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation)

Usage
-----

Expand Down
20 changes: 20 additions & 0 deletions aws-cloudformation-resourcedefaultversion/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# macOS
.DS_Store
._*

# Maven outputs
.classpath

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

# auto-generated files
target/

# our logs
rpdk.log
17 changes: 17 additions & 0 deletions aws-cloudformation-resourcedefaultversion/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"typeName": "AWS::CloudFormation::ResourceDefaultVersion",
"language": "java",
"runtime": "java8",
"entrypoint": "software.amazon.cloudformation.resourcedefaultversion.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.cloudformation.resourcedefaultversion.HandlerWrapper::testEntrypoint",
"settings": {
"namespace": [
"software",
"amazon",
"cloudformation",
"resourcedefaultversion"
],
"codegen_template_path": "guided_aws",
"protocolVersion": "2.0.0"
}
}
24 changes: 24 additions & 0 deletions aws-cloudformation-resourcedefaultversion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# AWS::CloudFormation::ResourceDefaultVersion


## Sample Usage

```
Resources:
InitialType:
Type: AWS::CloudFormation::ResourceVersion
Properties:
TypeName: Sample::CloudFormation::Resource
SchemaHandlerPackage: s3://cloudformationmanageduploadinfrast-artifactbucket-123456789012abcdef/sample-cloudformation-resource.zip
UpdatedType:
Type: AWS::CloudFormation::ResourceVersion
Properties:
TypeName: Sample::CloudFormation::Resource
SchemaHandlerPackage: s3://cloudformationmanageduploadinfrast-artifactbucket-123456789012abcdef/sample-cloudformation-resource-update.zip
DependsOn: InitialType

DefaultVersion:
Type: AWS::CloudFormation::ResourceDefaultVersion
Properties:
Arn: !Ref UpdatedType
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"typeName": "AWS::CloudFormation::ResourceDefaultVersion",
"description": "The default version of a resource that has been registered in the CloudFormation Registry.",
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation",
"properties": {
"Arn": {
"description": "The Amazon Resource Name (ARN) of the type version.",
"pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$",
"type": "string"
},
"TypeName": {
"description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.",
"pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$",
"type": "string"
},
"VersionId": {
"description": "The ID of an existing version of the resource to set as the default.",
"pattern": "^[A-Za-z0-9-]{1,128}$",
"type": "string"
}
},
"oneOf": [
{
"required": [
"Arn"
]
},
{
"required": [
"TypeName",
"VersionId"
]
}
],
"primaryIdentifier": [
"/properties/Arn"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is provided by customers?

],
"handlers": {
"create": {
"permissions": [
"cloudformation:SetTypeDefaultVersion"
]
},
"read": {
"permissions": [
"cloudformation:DescribeType"
]
},
"update": {
"permissions": [
"cloudformation:SetTypeDefaultVersion"
]
},
"delete": {
"permissions": [
""
]
}
},
"additionalProperties": false
}
76 changes: 76 additions & 0 deletions aws-cloudformation-resourcedefaultversion/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# AWS::CloudFormation::ResourceDefaultVersion

The default version of a resource that has been registered in the CloudFormation Registry.

## Syntax

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

### JSON

<pre>
{
"Type" : "AWS::CloudFormation::ResourceDefaultVersion",
"Properties" : {
"<a href="#arn" title="Arn">Arn</a>" : <i>String</i>,
"<a href="#typename" title="TypeName">TypeName</a>" : <i>String</i>,
"<a href="#versionid" title="VersionId">VersionId</a>" : <i>String</i>
}
}
</pre>

### YAML

<pre>
Type: AWS::CloudFormation::ResourceDefaultVersion
Properties:
<a href="#arn" title="Arn">Arn</a>: <i>String</i>
<a href="#typename" title="TypeName">TypeName</a>: <i>String</i>
<a href="#versionid" title="VersionId">VersionId</a>: <i>String</i>
</pre>

## Properties

#### Arn

The Amazon Resource Name (ARN) of the type version.

_Required_: No

_Type_: String

_Pattern_: <code>^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$</code>

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

#### TypeName

The name of the type being registered.

We recommend that type names adhere to the following pattern: company_or_organization::service::type.

_Required_: No

_Type_: String

_Pattern_: <code>^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$</code>

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

#### VersionId

The ID of an existing version of the resource to set as the default.

_Required_: No

_Type_: String

_Pattern_: <code>^[A-Za-z0-9-]{1,128}$</code>

_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 Arn.
1 change: 1 addition & 0 deletions aws-cloudformation-resourcedefaultversion/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading