Skip to content

brontolinux/tf-mod-cfengine-client

Repository files navigation

I built this module to create test clients for my CFEngine set-up. The set-up is very specific and may not be useful in a general case. The module itself however could be useful as a starting point for building generic test clients.

See the ARCHITECTURE document for details.

Requirements

The following requirements are needed by this module:

  • terraform (>= 0.13)

  • aws (~> 3.21.0)

  • template (~> 2.2.0)

Providers

The following providers are used by this module:

  • aws (~> 3.21.0)

  • template (~> 2.2.0)

Required Inputs

The following input variables are required:

cfengine_deb_package_version

Description: Official deb package version to install (e.g. 3.15.0-2)

Type: string

cfengine_server

Description: IP or DNS name of the cfengine server, used to bootstrap the clients

Type: string

instance_name

Description: Value for the Name tag for the instance

Type: string

instance_sg_name

Description: Value of the Name tag for the security group that applies to the instance (used to look up the security group for the instance, must be unique)

Type: string

instance_type

Description: Instance type for the CFEngine server

Type: string

pub_subnet_name

Description: Value of the Name tag for the public subnet (used to look up the public subnet for the instance, must be unique)

Type: string

ssh_key_name

Description: Name of the SSH key pair to install on the instance

Type: string

Optional Inputs

The following input variables are optional (have default values):

ami_id

Description: Set to 'latest' to use the latest official Debian 'buster' AMI, or specify an AMI ID to use a different one

Type: string

Default: "latest"

spot_instance

Description: Run the client on a spot instance

Type: bool

Default: true

Outputs

The following outputs are exported:

debian_ami_id

Description: Id of the latest AMI of Debian 10 for amd64 processors

eip_address

Description: Public (elastic) IP for the instance

eip_name

Description: DNS name associated to the public (elastic) IP for the instance

instance_id

Description: Id for the instance running the service

private_ip

Description: Private IP for the instance

public_subnet_id

Description: Id of the public subnet (calculated from the subnet name)

security_group_id

Description: Id of the security group for the instance (calculated from the security group name)

spot_instance_request_id

Description: Spot instance request id (or null if on-demand instances are used)

ssh_command

Description: Command to run to connect to the instance via SSH