-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Terraform For Windows Test (#391)
- Loading branch information
1 parent
5991033
commit 8a25004
Showing
6 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ CWAGENT_VERSION | |
*.iml | ||
.terraform.* | ||
terraform.* | ||
.terraform/* | ||
**/.terraform/* | ||
coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
resource "aws_instance" "integration-test" { | ||
ami = data.aws_ami.latest.id | ||
instance_type = var.ec2_instance_type | ||
key_name = var.key_name | ||
iam_instance_profile = var.iam_instance_profile | ||
vpc_security_group_ids = var.vpc_security_group_ids | ||
get_password_data = true | ||
provisioner "remote-exec" { | ||
# @TODO when @ZhenyuTan-amz adds windows tests add "make integration-test" | ||
inline = [ | ||
"echo clone and install agent", | ||
"git clone ${var.github_repo}", | ||
"cd amazon-cloudwatch-agent", | ||
"git reset --hard ${var.github_sha}", | ||
"aws s3 cp s3://cloudwatch-agent-integration-bucket/integration-test/packaging/${var.github_sha}/amazon-cloudwatch-agent.msi .", | ||
"msiexec /i amazon-cloudwatch-agent.msi", | ||
] | ||
connection { | ||
type = "ssh" | ||
user = "Administrator" | ||
private_key = var.ssh_key | ||
password = rsadecrypt(self.password_data, var.ssh_key) | ||
host = self.public_dns | ||
target_platform = "windows" | ||
} | ||
} | ||
} | ||
|
||
data "aws_ami" "latest" { | ||
most_recent = true | ||
owners = ["self"] | ||
|
||
filter { | ||
name = "name" | ||
values = [var.ami] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
provider "aws" { | ||
region = var.region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
variable "ec2_instance_type" { | ||
type = string | ||
default = "t3a.xlarge" | ||
} | ||
|
||
variable "key_name" { | ||
type = string | ||
default = "cwagent-integ-test-key" | ||
} | ||
|
||
variable "iam_instance_profile" { | ||
type = string | ||
default = "CloudWatchAgentServerRole" | ||
} | ||
|
||
variable "vpc_security_group_ids" { | ||
type = list(string) | ||
default = ["sg-013585129c1f92bf0"] | ||
} | ||
|
||
variable "region" { | ||
type = string | ||
default = "us-west-2" | ||
} | ||
|
||
variable "ami" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "ssh_key" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "github_sha" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "github_repo" { | ||
type = string | ||
default = "" | ||
} |