Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
5c1f9e4c
Commit
5c1f9e4c
authored
Nov 25, 2013
by
Jack Pearkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
website: use user variables in the intro (ec2)
parent
9cabad47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
website/source/intro/getting-started/build-image.html.markdown
...te/source/intro/getting-started/build-image.html.markdown
+15
-6
No files found.
website/source/intro/getting-started/build-image.html.markdown
View file @
5c1f9e4c
...
...
@@ -46,10 +46,14 @@ briefly. Create a file `example.json` and fill it with the following contents:
<pre
class=
"prettyprint"
>
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "
YOUR KEY HERE
",
"secret_key": "
YOUR SECRET KEY HERE
",
"access_key": "
{{user
`aws_access_key`
}}
",
"secret_key": "
{{user
`aws_secret_key`
}}
",
"region": "us-east-1",
"source_ami": "ami-de0d9eb7",
"instance_type": "t1.micro",
...
...
@@ -59,9 +63,11 @@ briefly. Create a file `example.json` and fill it with the following contents:
}
</pre>
Please fill in the
`access_key`
and
`secret_key`
with the proper values
for your account. Your security credentials can be found on
[
this page
](
https://console.aws.amazon.com/iam/home?#security_credential
)
.
When building, you'll pass in the
`aws_access_key`
and
`aws_access_key`
as
a
[
user variable
](
/docs/templates/user-variables.html
)
, keeping your secret
keys out of the template. You can create security credentials
on
[
this page
](
https://console.aws.amazon.com/iam/home?#security_credential
)
.
An example IAM policy document can be found in the
[
Amazon EC2 builder docs
](
/docs/builders/amazon.html
)
.
This is a basic template that is ready-to-go. It should be immediately recognizable
as a normal, basic JSON object. Within the object, the
`builders`
section
...
...
@@ -106,7 +112,10 @@ should look similar to below. Note that this process typically takes a
few minutes.
```
$ packer build example.json
$ packer build \
-var 'aws_access_key=YOUR ACCESS KEY' \
-var 'aws_secret_key=YOUR SECRET KEY' \
example.json
==> amazon-ebs: amazon-ebs output will be in this color.
==> amazon-ebs: Creating temporary keypair for this instance...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment