module "template" {
source = "github.com/ministryofjustice/modernisation-platform-terraform-module-template"
tags = local.tags
application_name = local.application_name
}
If you're looking to raise an issue with this module, please create a new issue in the Modernisation Platform repository.
Name | Version |
---|---|
terraform | >= 1.1.7 |
aws | ~> 5.0 |
cloudinit | ~> 2.3.5 |
random | ~> 3.4 |
time | > 0.9.0 |
Name | Version |
---|---|
aws | ~> 5.0 |
cloudinit | ~> 2.3.5 |
random | ~> 3.4 |
No modules.
Name | Type |
---|---|
aws_autoscaling_group.this | resource |
aws_autoscaling_schedule.this | resource |
aws_cloudwatch_metric_alarm.this | resource |
aws_iam_instance_profile.this | resource |
aws_iam_role.this | resource |
aws_iam_role_policy.lifecycle_hooks | resource |
aws_iam_role_policy.ssm_params_and_secrets | resource |
aws_launch_template.this | resource |
aws_lb_target_group.this | resource |
aws_secretsmanager_secret.fixed | resource |
aws_secretsmanager_secret.placeholder | resource |
aws_secretsmanager_secret_version.fixed | resource |
aws_ssm_parameter.placeholder | resource |
aws_ssm_parameter.this | resource |
random_password.secrets | resource |
random_password.this | resource |
aws_ami.this | data source |
aws_caller_identity.current | data source |
aws_ec2_instance_type.this | data source |
aws_iam_policy_document.lifecycle_hooks | data source |
aws_iam_policy_document.ssm_params_and_secrets | data source |
cloudinit_config.this | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
account_ids_lookup | A map of account names to account ids that can be used for AMI owner | map(any) |
{} |
no |
ami_name | Name of AMI to be used to launch the ec2 instance | string |
n/a | yes |
ami_owner | Owner of AMI to be used to launch the ec2 instance | string |
"core-shared-services-production" |
no |
application_name | The name of the application. This will be name of the environment in Modernisation Platform | string |
n/a | yes |
autoscaling_group | See aws_autoscaling_group documentation | object({ |
n/a | yes |
autoscaling_schedules | See aws_autoscaling_schedule documentation. Key=name. Values are taken from equivalent autoscaling_group value if null | map(object({ |
n/a | yes |
availability_zone | Optionally associated the ASG with a single availability zone | string |
null |
no |
cloudwatch_metric_alarms | Map of cloudwatch metric alarms. The alarm name is set to the autoscaling group name plus the map key. | map(object({ |
{} |
no |
ebs_kms_key_id | KMS Key to use for EBS volumes if not explicitly set in ebs_volumes variable. If null, uses the local account key or the corresponding AMI volume ebs key | string |
null |
no |
ebs_volume_config | EC2 volume configurations, where key is a label, e.g. flash, which is assigned to the disk in ebs_volumes. All disks with same label have the same configuration. If not specified, use values from the AMI. If total_size specified, the volume size is this divided by the number of drives with the given label | map(object({ |
n/a | yes |
ebs_volume_tags | Additional tags to apply to ebs volumes | map(string) |
{} |
no |
ebs_volumes | EC2 volumes, see aws_ebs_volume for documentation. key=volume name, value=ebs_volume_config key. label is used as part of the Name tag | map(object({ |
n/a | yes |
ebs_volumes_copy_all_from_ami | If true, ensure all volumes in AMI are also present in EC2. If false, only create volumes specified in ebs_volumes var | bool |
true |
no |
iam_resource_names_prefix | Prefix IAM resources with this prefix, e.g. ec2-database | string |
"ec2" |
no |
instance | EC2 launch template / instance settings, see aws_instance documentation | object({ |
n/a | yes |
instance_profile_policies | A list of managed IAM policy document ARNs to be attached to the instance profile | list(string) |
n/a | yes |
lb_target_groups | Map of load balancer target groups, where key is the name. vpc_id needs setting if this is used | map(object({ |
{} |
no |
name | Provide a unique name for the auto scale group | string |
n/a | yes |
region | Destination AWS Region for the infrastructure | string |
"eu-west-2" |
no |
secretsmanager_secrets | A map of secretsmanager secrets to create. Set a specific value or a randomly generated value. If neither random or value are set, a placeholder value is created which can be updated outside of terraform | map(object({ |
null |
no |
secretsmanager_secrets_prefix | Optionally prefix secretsmanager secrets with this prefix. Add a trailing / | string |
"" |
no |
ssm_parameters | A map of SSM parameters to create. Set a specific value or a randomly generated value. If neither random or value are set, a placeholder value is created which can be updated outside of terraform | map(object({ |
null |
no |
ssm_parameters_prefix | Optionally prefix ssm parameters with this prefix. Add a trailing / | string |
"" |
no |
subnet_ids | List of subnet ids given to the ASG to set the associated AZs (and therefore redundancy of the ASG instances) | list(string) |
n/a | yes |
tags | Default tags to be applied to resources. Additional tags can be added to EBS volumes or EC2s, see instance.tags and ebs_volume_tags variables. | map(any) |
n/a | yes |
user_data_cloud_init | Use this instead of user_data_raw to run multiple scripts using cloud_init | object({ |
null |
no |
user_data_raw | Base64 encoded user data, script or cloud formation template | string |
null |
no |
vpc_id | vpc id which only needs populating if lb_target_groups is set | string |
null |
no |
Name | Description |
---|---|
autoscaling_group | map of aws_autoscaling_group details |
lb_target_groups | map of aws_lb_target_group resources |