-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Adding a HowTo Guide #44
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is super helpful to have, and like what you have written. Some minor comments. I wonder if there is a way to relate the weird AWS parts (things with templates and changesets) in an easier to understand way
HOWTO.md
Outdated
... | ||
``` | ||
|
||
## Packing Artifacts (Automated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think switching the order around so automatic would make more sense. That way people who are just taking a look get the easier version first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The Manual step felt redundant so I merged both of them together
|
||
To use this command, set `CodeUri` property to be the path to your | ||
source code folder/zip/jar and `DefinitionUri` property to be a path to | ||
your OpenAPI file, as shown in the example below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By OpenAPI do you mean swagger file? Is that the official name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the new official name
Run the following command to upload your artifacts to S3 and output a | ||
packaged template that can be readily deployed to CloudFormation. | ||
``` | ||
aws cloudformation package \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your examples above are using yaml, but your command for package uses json :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. fixed
``` | ||
|
||
|
||
## Deploying to AWS CloudFormation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the understanding of a changeset could be confusing for new users. Maybe have a brief description of what a changeset is and how cloudformation uses it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
HOWTO.md
Outdated
aws cloudformation deploy \ | ||
--template-file /path_to_template/packaged-template.json \ | ||
--stack-name my-new-stack \ | ||
--parameter-overrides Key1=Value1 Key2=Value2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these commands do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a description of the command
@roryj Addressed your comments |
HOWTO.md
Outdated
--template-file /path_to_template/packaged-template.json \ | ||
--stack-name my-new-stack \ | ||
--parameter-overrides Key1=Value1 Key2=Value2 | ||
--stack-name my-new-stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing a \
at the end of this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. fixed
## Deploying to AWS CloudFormation | ||
SAM template is deployed to AWS CloudFormation by [creating a changeset](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets-create.html) | ||
using the SAM template followed by [executing the changeset](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets-execute.html). | ||
Think of a ChangeSet as a diff between your current stack template and the new template that you are deploying. After you create a ChangeSet, you have the opportunity to examine the diff before executing it. Both the AWS Console and AWS CLI provide commands to create and execute a changeset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line is really helpful, and will make it clear what this does. 👍
@@ -0,0 +1,73 @@ | |||
# How to create serverless applications using AWS SAM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is the place to discuss what a stack is? I noticed we discussed it below, but didnt quite define what it is. I like your below definition of what a changeset is, but maybe a simple definition of a stack here would be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Done
Uploaded a new commit with an introduction to CloudFormation stacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad that you are adding this 👍 .
HOWTO.md
Outdated
using the SAM template followed by [executing the changeset](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets-execute.html). | ||
Think of a ChangeSet as a diff between your current stack template and the new template that you are deploying. After you create a ChangeSet, you have the opportunity to examine the diff before executing it. Both the AWS Console and AWS CLI provide commands to create and execute a changeset. | ||
|
||
Alternatively, you can use `aws cloudformation deploy` CLI command deploy the SAM template. Under-the-hood it creates and executes a changeset and waits until the deployment completes. It also print debugging hints when the deployment fails. Run the following command to deploy the packaged template to a stack called `my-new-stack`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLI command to deploy ...
If also prints debugging ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, will change
## Deploying to AWS CloudFormation | ||
SAM template is deployed to AWS CloudFormation by [creating a changeset](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets-create.html) | ||
using the SAM template followed by [executing the changeset](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets-execute.html). | ||
Think of a ChangeSet as a diff between your current stack template and the new template that you are deploying. After you create a ChangeSet, you have the opportunity to examine the diff before executing it. Both the AWS Console and AWS CLI provide commands to create and execute a changeset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is more of a cloudformation detail, but it might be worth mentioning that once a changeset is executed, other unused ones will be discarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is relevant to this audience. I'd rather not confuse them
HOWTO.md
Outdated
aws cloudformation package \ | ||
--template-file /path_to_template/template.yaml \ | ||
--s3-bucket bucket-name \ | ||
--output-template-file packaged-template.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wont the output be yaml too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it will be. Will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
No description provided.