Giter VIP home page Giter VIP logo

rhythmictech / terraform-aws-imagebuilder-component-ansible Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 5.0 95 KB

Create an EC2 Image Builder component that runs an Ansible playbook

Home Page: https://registry.terraform.io/modules/rhythmictech/imagebuilder-component-ansible/aws

License: MIT License

Smarty 23.34% HCL 59.68% Shell 16.98%
ansible terraform terraform-module aws cloudformation imagebuilder ec2

terraform-aws-imagebuilder-component-ansible's Introduction

terraform-aws-imagebuilder-component-ansible

Template repository for terraform modules. Good for any cloud and any provider.

tflint tfsec yamllint misspell pre-commit-check follow on Twitter

Terraform module that creates EC2 Image Builder components using ansible

Example

data "aws_caller_identity" "current" {
}

locals {
  account_id = data.aws_caller_identity.current.account_id
  tags       = module.tags.tags_no_name
}

module "tags" {
  source = "git::https://github.com/rhythmictech/terraform-terraform-tags.git?ref=v1.0.0"

  names = [
    "smiller",
    "imagebuilder-test"
  ]

  tags = merge({
    "Env"       = "test"
    "Namespace" = "smiller"
    "notes"     = "Testing only - Can be safely deleted"
    "Owner"     = var.owner
  }, var.additional_tags)
}

module "component_ansible_setup" {
  source  = "rhythmictech/imagebuilder-component-ansible-setup/aws"
  version = "~> 1.0.0-rc1"

  component_version = "1.0.0"
  description       = "Testing ansible setup"
  name              = "testing-setup-component"
  tags              = local.tags
}

module "component_ansible" {
  source  = "rhythmictech/imagebuilder-component-ansible/aws"
  version = "~> 2.0.0-rc1"

  component_version = "1.0.0"
  description       = "Testing component"
  name              = "testing-component"
  tags              = local.tags
}

module "test_recipe" {
  source  = "rhythmictech/imagebuilder-recipe/aws"
  version = "~> 0.2.0"

  description    = "Testing recipe"
  name           = "test-recipe"
  parent_image   = "arn:aws:imagebuilder:us-east-1:aws:image/amazon-linux-2-x86/x.x.x"
  recipe_version = "1.0.0"
  tags           = local.tags
  update         = true

  component_arns = [
    module.component_ansible_setup.component_arn,
    module.component_ansible.component_arn,
    "arn:aws:imagebuilder:us-east-1:aws:component/simple-boot-test-linux/1.0.0/1",
    "arn:aws:imagebuilder:us-east-1:aws:component/reboot-test-linux/1.0.0/1"
  ]
}

module "test_pipeline" {
  source  = "rhythmictech/imagebuilder-pipeline/aws"
  version = "~> 0.3.0"

  description = "Testing pipeline"
  name        = "test-pipeline"
  tags        = local.tags
  recipe_arn  = module.test_recipe.recipe_arn
  public      = false
}

About

This module allows creation of an Ansible Playbook component for use in EC2 Image Builder Recipes.

Requirements

Name Version
terraform >= 0.14
aws >= 4.22.0

Providers

Name Version
aws >= 4.22.0

Modules

No modules.

Resources

Name Type
aws_imagebuilder_component.this resource
aws_caller_identity.current data source
aws_region.current data source
aws_secretsmanager_secret.ssh_key data source

Inputs

Name Description Type Default Required
ansible_use_venv Whether or not ansible should be run in a virtual environment bool true no
ansible_venv_path Path at which to create the ansible virtual environment string "/var/tmp/ansible_venv/" no
change_description description of changes since last version string null no
component_version Version of the component string n/a yes
data_uri Use this to override the component document with one at a particualar URL endpoint string null no
description description of component string null no
kms_key_id KMS key to use for encryption string null no
name name to use for component string n/a yes
platform platform of component (Linux or Windows) string "Linux" no
playbook_dir directory where playbook and requirements are found (if not root of repo) string null no
playbook_file path to playbook file, relative to playbook_dir string "provision.yml" no
playbook_repo git url for repo where ansible code lives with provisioning playbook and requirements file
can append with -b BRANCH_NAME to clone a specific branch
string n/a yes
ssh_key_secret_arn ARN of a secretsmanager secret containing an SSH key (use arn OR name, not both) string null no
ssh_key_secret_name Name of a secretsmanager secret containing an SSH key (use arn OR name, not both) string null no
supported_os_versions A set of operating system versions supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation. set(string) null no
tags map of tags to use for CFN stack and component map(string) {} no

Outputs

Name Description
component_arn ARN of the EC2 Image Builder Component
latest_minor_version_arn ARN of the EC2 Image Builder Component

The Giants underneath this module

  • pre-commit.com/
  • terraform.io/
  • github.com/tfutils/tfenv
  • github.com/segmentio/terraform-docs

terraform-aws-imagebuilder-component-ansible's People

Contributors

cdaniluk avatar dgoodellrhy avatar pierrekerschgens avatar sblack4 avatar sdickenson avatar smiller171 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-aws-imagebuilder-component-ansible's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.