Skip to content

Commit bc68113

Browse files
ckesseromkhegde
andauthored
Periodic doc refresh (#858)
* Periodic doc refresh Bring docs up-to-date with https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html#resource-type-setup Co-authored-by: Omkar Hegde <[email protected]>
1 parent 1888334 commit bc68113

32 files changed

+1941
-421
lines changed

doc_source/contract-tests.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contract tests<a name="contract-tests"></a>
2+
3+
As part of testing your resource, the CloudFormation CLI performs a suite of tests, each written to test a requirement contained in the [resource type handler contract](resource-type-test-contract.md)\. Each handler invocation is expected to follow the general requirements for that handler listed in the contract\. This topic lists tests that explicitly test some of the more specific requirements\.
4+
5+
## `create` handler tests<a name="contract-tests-create"></a>
6+
7+
The CloudFormation CLI performs the following contract tests for `create` handlers\.
8+
9+
10+
| Test | Description |
11+
| --- | --- |
12+
| **contract\_create\_create** | Creates a resource, waits for the resource creation to complete, and then creates the resource again with the expectation that the second create operation will fail with the `AlreadyExists` error code\. This test is not run for resources if the primary identifier or any additional identifiers are read\-only\. |
13+
| **contract\_create\_read** | Creates a resource, waits for the resource creation to complete, and then reads the created resource to ensure that the input to the `create` handler is equal to the output from the `read` handler\. The comparison ignores any read\-only/generated properties in the `read` output, as create input cannot specify these\. It also ignores any write\-only properties in the create input, as these are removed from read output to avoid security issues\. |
14+
| **contract\_create\_delete** | Creates a resource, waits for the resource creation to complete, and then deletes the created resource\. It also checks if the create input is equal to the create output \(which is then used for delete input\), with the exception of readOnly and writeOnly properties\. |
15+
| **contract\_create\_list** | Creates a resource, waits for the resource creation to complete, and then lists out the resources with the expectation that the created resource exists in the returned list\. |
16+
17+
## `update` handler tests<a name="contract-tests-update"></a>
18+
19+
The CloudFormation CLI performs the following contract tests for `update` handlers\.
20+
21+
22+
| Test | Description |
23+
| --- | --- |
24+
| **contract\_update\_read** | Creates a resource, updates the resource, and then reads the resource to check that the update was made by comparing the read output with the update input\. The comparison excludes read\-only and write\-only properties because they cannot be included in the update input and read output, respectively\. |
25+
| **contract\_update\_list** | Creates a resource, updates the resource, and then lists the resource to check that the updated resource exists in the returned list\. |
26+
| **contract\_update\_without\_create** | Updates a resource without creating it first\. The test expects the update operation to fail with the `NotFound` error code\. |
27+
28+
## `delete` handler tests<a name="contract-tests-delete"></a>
29+
30+
The CloudFormation CLI performs the following contract tests for `delete` handlers\.
31+
32+
33+
| Test | Description |
34+
| --- | --- |
35+
| **contract\_delete\_create** | Creates a resource, deletes the resource, and then creates the resource again with the expectation that the deletion was successful and a new resource can be created\. The CloudFormation CLI performs this contract test for resources with create\-only primary identifiers\. |
36+
| **contract\_delete\_update** | Creates a resource, deletes the resource, and then updates the resource with the expectation that the update operation will fail with the `NotFound` error code\. |
37+
| **contract\_delete\_read** | Creates a resource, deletes the resource, and then reads the resource with the expectation that the read operation will fail with the `NotFound` error code\. |
38+
| **contract\_delete\_list** | Creates a resource, deletes the resource, and then lists the resource with the expectation that the returned list does not contain the deleted resource\. |
39+
| **contract\_delete\_delete** | Creates a resource, deletes the resource, and then deletes the resource again with the expectation that the second delete operation will fail with the `NotFound` error code\. |

doc_source/glossary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# AWS Glossary<a name="glossary"></a>
1+
# AWS glossary<a name="glossary"></a>
22

3-
For the latest AWS terminology, see the [AWS Glossary](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html) in the *AWS General Reference*\.
3+
For the latest AWS terminology, see the [AWS glossary](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html) in the *AWS General Reference*\.

doc_source/index.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# CloudFormation Command Line Interface User Guide for Type Development
1+
# CloudFormation Command Line Interface User Guide for Extension Development
22

33
-----
4-
*****Copyright &copy; 2019 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.*****
4+
*****Copyright &copy; Amazon Web Services, Inc. and/or its affiliates. All rights reserved.*****
55

66
-----
77
Amazon's trademarks and trade dress may not be used in
@@ -14,22 +14,34 @@ Amazon's trademarks and trade dress may not be used in
1414

1515
-----
1616
## Contents
17-
+ [What Is the CloudFormation Command Line Interface?](what-is-cloudformation-cli.md)
18-
+ [Creating Resource Providers](resource-types.md)
19-
+ [Setting Up Your Environment for Developing Resource Providers](resource-type-setup.md)
20-
+ [Modeling Resource Providers for Use in AWS CloudFormation](resource-type-model.md)
21-
+ [Resource Provider Schema](resource-type-schema.md)
22-
+ [Developing Resource Providers for Use in AWS CloudFormation Templates](resource-type-develop.md)
23-
+ [Global Parameters](resource-type-cli-global-parameters.md)
24-
+ [init](resource-type-cli-init.md)
25-
+ [generate](resource-type-cli-generate.md)
26-
+ [validate](resource-type-cli-validate.md)
27-
+ [invoke](resource-type-cli-invoke.md)
28-
+ [test](resource-type-cli-test.md)
29-
+ [submit](resource-type-cli-submit.md)
30-
+ [Progress Chaining, Stabilization and Callback Pattern](resource-type-develop-stabilize.md)
31-
+ [Registering Resource Providers for Use in AWS CloudFormation Templates](resource-type-register.md)
32-
+ [Walkthrough: Develop a Resource Provider](resource-type-walkthrough.md)
33-
+ [Resource Provider FAQ](resource-type-faq.md)
17+
+ [What is the CloudFormation Command Line Interface (CLI)?](what-is-cloudformation-cli.md)
18+
+ [Creating resource types](resource-types.md)
19+
+ [Modeling resource types for use in AWS CloudFormation](resource-type-model.md)
20+
+ [Resource type schema](resource-type-schema.md)
21+
+ [Patterns for modeling your resource types](resource-type-howtos.md)
22+
+ [Preventing false drift detection results for resource types](resource-type-model-false-drift.md)
23+
+ [Developing resource types for use in AWS CloudFormation Templates](resource-type-develop.md)
24+
+ [Testing resource types using contract tests](resource-type-test.md)
25+
+ [Resource type handler contract](resource-type-test-contract.md)
26+
+ [Contract tests](contract-tests.md)
27+
+ [Handler error codes](resource-type-test-contract-errors.md)
28+
+ [ProgressEvent object schema](resource-type-test-progressevent.md)
29+
+ [Progress chaining, stabilization and callback pattern](resource-type-develop-stabilize.md)
30+
+ [Walkthrough: Develop a resource type](resource-type-walkthrough.md)
31+
+ [Resource type FAQ](resource-type-faq.md)
32+
+ [Developing modules](modules.md)
33+
+ [Module structure](modules-structure.md)
34+
+ [Develop a module using the CFN-CLI](modules-develop.md)
35+
+ [Registering extensions for use in the CloudFormation registry](resource-type-register.md)
36+
+ [Publishing extensions to make them available for public use](publish-extension.md)
37+
+ [Publishing your extension in multiple Regions using AWS CloudFormation StackSets](publish-extension-stacksets.md)
38+
+ [CloudFormation CLI command reference](resource-type-cli.md)
39+
+ [Global parameters](resource-type-cli-global-parameters.md)
40+
+ [init](resource-type-cli-init.md)
41+
+ [generate](resource-type-cli-generate.md)
42+
+ [validate](resource-type-cli-validate.md)
43+
+ [invoke](resource-type-cli-invoke.md)
44+
+ [test](resource-type-cli-test.md)
45+
+ [submit](resource-type-cli-submit.md)
3446
+ [Document History for User Guide](doc-history.md)
35-
+ [AWS Glossary](glossary.md)
47+
+ [AWS glossary](glossary.md)

doc_source/modules-develop.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Develop a module using the CFN\-CLI<a name="modules-develop"></a>
2+
3+
Follow these basic steps to develop and register a module project\.
4+
5+
1. In the CFN\-CLI, use the `[init](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-init.html)` command to create a new project\. The `init` command creates a `fragments` folder containing a sample fragment file named `sample.json`\.
6+
7+
Follow the prompts\. Specify that you want to create a **module\(m\)**, and enter the module name\.
8+
9+
```
10+
cfn init
11+
Initializing new project
12+
Do you want to develop a new resource(r) or a module(m)?.
13+
>> m
14+
What is the name of your module type?
15+
(<Organization>::<Service>::<Name>::MODULE)
16+
>> My::Sample::SampleBucket::MODULE
17+
```
18+
19+
1. Include your template fragment in the project\.
20+
21+
In the `fragments` folder in the project, you should find a file named `sample.json`\. This is the template fragment file\. Author your template fragment in this file and save\.
22+
23+
You can rename this file as necessary\. The folder can only contain a single file\.
24+
25+
For more information, see [Creating a module template fragment](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/modules-structure.html#modules-template-fragment)\.
26+
27+
1. Use `[validate](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-validate.html)` to validate your project\. Fix any issues reported\.
28+
29+
The `validate` command regenerates the module schema, based on the template fragment you included in the `fragments` folder\. The module schema is located in the root folder, and named `schema.json`\.
30+
31+
1. Use `[submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html)` to register the module with CloudFormation, in the specified region\. Registering a module makes it available for inclusion in CloudFormation templates\.
32+
**Note**
33+
When you register your module using `submit`, CloudFormation re\-generates your module schema based on the template fragment in your project\. You can't specify a schema file directly\. To specify a module schema file when registering a module, use `[RegisterType](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html)` in the CloudFormation API\.
34+
35+
For information on using modules in CloudFormation templates, see [Using modules](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html) in the *CloudFormation Users Guide*\.

0 commit comments

Comments
 (0)