forked from awslabs/goformation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(generator): moving resources and policies into their own pac…
…kages (awslabs#161) BREAKING CHANGE: this PR refactors the auto-generated CloudFormation resources out of the cloudformation package and into a dedicated package (resources). This helps keep the auto generated files separate from others. E.g. cloudformation.AWSSnsTopic{} becomes resources.AWSSnsTopic{}
- Loading branch information
1 parent
651d072
commit 03a0123
Showing
1,184 changed files
with
8,887 additions
and
6,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# AWS GoFormation | ||
|
||
[![Build Status](https://travis-ci.org/awslabs/goformation.svg?branch=0.1.0)](https://travis-ci.org/awslabs/goformation) [![GoDoc Reference](https://godoc.org/gopkg.in/awslabs/goformation.v1?status.svg)](http://godoc.org/github.com/awslabs/goformation) ![Apache-2.0](https://img.shields.io/badge/Licence-Apache%202.0-blue.svg) | ||
[![Build Status](https://travis-ci.org/awslabs/goformation.svg?branch=0.1.0)](https://travis-ci.org/awslabs/goformation) [![GoDoc Reference](https://godoc.org/gopkg.in/awslabs/goformation.v1?status.svg)](http://godoc.org/github.com/awslabs/goformation) ![Apache-2.0](https://img.shields.io/badge/Licence-Apache%202.0-blue.svg) | ||
|
||
`GoFormation` is a Go library for working with AWS CloudFormation / AWS Serverless Application Model (SAM) templates. | ||
`GoFormation` is a Go library for working with AWS CloudFormation / AWS Serverless Application Model (SAM) templates. | ||
- [Main features](#main-features) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
|
@@ -45,6 +45,7 @@ import ( | |
"time" | ||
|
||
"github.com/awslabs/goformation/cloudformation" | ||
"github.com/awslabs/goformation/cloudformation/resources" | ||
) | ||
|
||
func main() { | ||
|
@@ -53,12 +54,12 @@ func main() { | |
template := cloudformation.NewTemplate() | ||
|
||
// Create an Amazon SNS topic, with a unique name based off the current timestamp | ||
template.Resources["MyTopic"] = &cloudformation.AWSSNSTopic{ | ||
template.Resources["MyTopic"] = &resources.AWSSNSTopic{ | ||
TopicName: "my-topic-" + strconv.FormatInt(time.Now().Unix(), 10), | ||
} | ||
|
||
// Create a subscription, connected to our topic, that forwards notifications to an email address | ||
template.Resources["MyTopicSubscription"] = &cloudformation.AWSSNSSubscription{ | ||
template.Resources["MyTopicSubscription"] = &resources.AWSSNSSubscription{ | ||
TopicArn: cloudformation.Ref("MyTopic"), | ||
Protocol: "email", | ||
Endpoint: "[email protected]", | ||
|
@@ -146,7 +147,7 @@ When creating templates, you can use the following convenience functions to use | |
- `Not(conditions []string)` | ||
- `Or(conditions []string)` | ||
|
||
### Unmarshalling CloudFormation YAML/JSON into Go structs | ||
### Unmarshalling CloudFormation YAML/JSON into Go structs | ||
|
||
GoFormation also works the other way - parsing JSON/YAML CloudFormation/SAM templates into Go structs. | ||
|
||
|
@@ -191,7 +192,7 @@ func main() { | |
``` | ||
|
||
## Updating CloudFormation / SAM Resources in GoFormation | ||
|
||
AWS GoFormation contains automatically generated Go structs for every CloudFormation/SAM resource, located in the [cloudformation/](cloudformation/) directory. These can be generated, from the latest [AWS CloudFormation Resource Specification](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) published for `us-east-1` by just running `go generate`: | ||
|
||
``` | ||
|
@@ -216,13 +217,13 @@ The following [AWS CloudFormation Intrinsic Functions](http://docs.aws.amazon.co | |
- [x] [Fn::Select](intrinsics/fnselect.go) | ||
- [x] [Fn::Split](intrinsics/fnsplit.go) | ||
- [x] [Fn::Sub](intrinsics/fnsub.go) | ||
- [x] [Ref](intrinsics/ref.go) | ||
- [x] [Fn::And](intrinsics/fnand.go) | ||
- [x] [Fn::Equals](intrinsics/fnequals.go) | ||
- [x] [Fn::If](intrinsics/fnif.go) | ||
- [x] [Fn::Not](intrinsics/fnnot.go) | ||
- [x] [Fn::Or](intrinsics/fnor.go) | ||
- [ ] Fn::GetAtt | ||
- [x] [Ref](intrinsics/ref.go) | ||
- [x] [Fn::And](intrinsics/fnand.go) | ||
- [x] [Fn::Equals](intrinsics/fnequals.go) | ||
- [x] [Fn::If](intrinsics/fnif.go) | ||
- [x] [Fn::Not](intrinsics/fnnot.go) | ||
- [x] [Fn::Or](intrinsics/fnor.go) | ||
- [ ] Fn::GetAtt | ||
- [x] [Fn::GetAZs](intrinsics/fngetazs.go) | ||
- [ ] Fn::ImportValue | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
cloudformation/aws-cloudfront-distribution_legacycustomorigin.go
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
cloudformation/aws-cloudfront-distribution_legacys3origin.go
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
cloudformation/policies.go → cloudformation/policies/policies.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.