mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-01 05:27:24 +08:00
129 lines
3.9 KiB
JSON
129 lines
3.9 KiB
JSON
{
|
|
"variables": {
|
|
"vpc": "{{env `BUILD_VPC_ID`}}",
|
|
"subnet": "{{env `BUILD_SUBNET_ID`}}",
|
|
"aws_region": "{{env `AWS_REGION`}}",
|
|
"destination_regions": "{{env `DESTINATION_REGIONS`}}",
|
|
"instance_type": "{{env `INSTANCE_TYPE`}}",
|
|
"teleport_version": "{{env `TELEPORT_VERSION`}}",
|
|
"teleport_uid": "{{env `TELEPORT_UID`}}",
|
|
"teleport_type": "{{env `TELEPORT_TYPE`}}",
|
|
"telegraf_version": "{{env `TELEGRAF_VERSION`}}",
|
|
"influxdb_version": "{{env `INFLUXDB_VERSION`}}",
|
|
"grafana_version": "{{env `GRAFANA_VERSION`}}",
|
|
"ami_name": "teleport-debug-ami-{{env `TELEPORT_TYPE`}}-{{env `TELEPORT_VERSION`}}",
|
|
"build_type": "debug"
|
|
},
|
|
"builders": [{
|
|
"name": "teleport-aws-linux",
|
|
"ami_description": "Gravitational Teleport using AWS Linux AMI",
|
|
"type": "amazon-ebs",
|
|
"region": "{{user `aws_region`}}",
|
|
"source_ami_filter": {
|
|
"filters": {
|
|
"virtualization-type": "hvm",
|
|
"name": "amzn2-ami-hvm*-ebs",
|
|
"root-device-type": "ebs"
|
|
},
|
|
"owners": ["amazon"],
|
|
"most_recent": true
|
|
},
|
|
"instance_type": "{{user `instance_type`}}",
|
|
"ssh_username": "ec2-user",
|
|
"ami_name": "{{user `ami_name` | clean_resource_name}}",
|
|
"ssh_pty" : true,
|
|
"associate_public_ip_address": true,
|
|
"vpc_id": "{{user `vpc`}}",
|
|
"subnet_id": "{{user `subnet`}}",
|
|
"ami_regions": "{{user `destination_regions`}}",
|
|
"force_delete_snapshot": "true",
|
|
"tags": {
|
|
"Name": "{{user `ami_name`}}",
|
|
"BuildTimestamp": "{{user `build_timestamp`}}",
|
|
"BuildType": "production"
|
|
},
|
|
"run_tags": {
|
|
"Name": "{{user `ami_name`}}"
|
|
},
|
|
"run_volume_tags": {
|
|
"Name": "{{user `ami_name`}}"
|
|
},
|
|
"snapshot_tags": {
|
|
"Name": "{{user `ami_name`}}"
|
|
}
|
|
},{
|
|
"name": "teleport-aws-linux-fips",
|
|
"ami_description": "Gravitational Teleport with FIPS support using AWS Linux AMI",
|
|
"type": "amazon-ebs",
|
|
"region": "{{user `aws_region`}}",
|
|
"source_ami_filter": {
|
|
"filters": {
|
|
"virtualization-type": "hvm",
|
|
"name": "amzn2-ami-hvm*-ebs",
|
|
"root-device-type": "ebs"
|
|
},
|
|
"owners": ["amazon"],
|
|
"most_recent": true
|
|
},
|
|
"instance_type": "{{user `instance_type`}}",
|
|
"ssh_username": "ec2-user",
|
|
"ami_name": "{{user `fips_ami_name` | clean_resource_name}}",
|
|
"ssh_pty" : true,
|
|
"associate_public_ip_address": true,
|
|
"vpc_id": "{{user `vpc`}}",
|
|
"subnet_id": "{{user `subnet`}}",
|
|
"ami_regions": "{{user `destination_regions`}}",
|
|
"force_delete_snapshot": "true",
|
|
"tags": {
|
|
"Name": "{{user `fips_ami_name`}}",
|
|
"BuildTimestamp": "{{user `build_timestamp`}}",
|
|
"BuildType": "production-fips"
|
|
},
|
|
"run_tags": {
|
|
"Name": "{{user `fips_ami_name`}}"
|
|
},
|
|
"run_volume_tags": {
|
|
"Name": "{{user `fips_ami_name`}}"
|
|
},
|
|
"snapshot_tags": {
|
|
"Name": "{{user `fips_ami_name`}}"
|
|
}
|
|
}],
|
|
"provisioners": [{
|
|
"inline": [
|
|
"mkdir /tmp/files"
|
|
],
|
|
"type": "shell"
|
|
},{
|
|
"type": "file",
|
|
"source": "files/",
|
|
"destination": "/tmp/files"
|
|
},{
|
|
"inline": [
|
|
"sudo cp /tmp/files/system/* /etc/systemd/system/",
|
|
"sudo cp /tmp/files/bin/* /usr/local/bin/"
|
|
],
|
|
"type": "shell"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"touch /tmp/teleport-fips"
|
|
],
|
|
"only": ["teleport-aws-linux-fips"]
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"script": "files/install.sh",
|
|
"execute_command": "chmod +x {{ .Path }}; echo 'root' | {{.Vars}} sudo -S -E bash -eux '{{.Path}}'",
|
|
"environment_vars": [
|
|
"TELEPORT_UID={{user `teleport_uid`}}",
|
|
"TELEPORT_VERSION={{user `teleport_version`}}",
|
|
"TELEPORT_TYPE={{user `teleport_type`}}",
|
|
"TELEGRAF_VERSION={{user `telegraf_version`}}",
|
|
"INFLUXDB_VERSION={{user `influxdb_version`}}",
|
|
"GRAFANA_VERSION={{user `grafana_version`}}"
|
|
]
|
|
}]
|
|
}
|