A Concourse CI resource to build new Amazon Machine Images (AMI) via Packer
region
(optional string): The AWS region to work in - defaults to AWS_REGION environment variableowners
(optional list): The list of owners to use when searching for AMI during checkexecutable_users
(optional list): The list of executable users to use when searching for AMI during checkfilters
(optional map): The filters to match when searching for AMI during check
Returns an ordered list of versions that match the criteria specified in the source. This can be used to trigger a new build when an AMI is updated.
Provides 3 files:
version.txt
- a text file containing the selected AMI idversion.json
- a JSON file containing the selected AMI id in theami
fieldimage.json
- the AWS metadata for the selected AMI
template
(required string): The path to the packer template.var_file
(optional string or list): The path or list of paths to a [external JSON variable file] (https://www.packer.io/docs/templates/user-variables.html).credentials
(optional string): The path to the AWS credentials file to useprofile
(optional string): The AWS profile to use (defaults todefault
)
All other parameters will be passed through to packer as variables.
resource_types:
- name: packer
type: docker-image
source:
repository: subnova/packer-resource
resources:
- name: base-ami
type: packer
source:
region: eu-west-1
owners: ["12345678"]
filters:
name: ["Ubuntu *"]
"tag:System": ["packer"]
- name: created-ami
type: packer
source:
region: eu-west-1
owners: [self]
filters:
name: ["My amazing AMI *"]
- name: my-ami-source
type: git
source:
uri: https://github.com/abc/repo
jobs:
- name: my-ami
plan:
- get: my-ami-source
trigger: true
- get: base-ami
trigger: true
- put: created-ami
params:
template: my-ami-source/packer_template.json
var_file:
- base-ami/version.json
- my-ami-source/packer_params.json