mirror of
https://github.com/inspec/inspec
synced 2024-11-24 05:33:17 +00:00
15459ca295
* Add access_keys method to aws_iam_user Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Fix unit test that accessed AWS Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Incorporate PR feedback Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Fix unit tests Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Update tests based on PR feedback Signed-off-by: Chris Redekop <chris.redekop@d2l.com> * Rebase to master Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
54 lines
1.2 KiB
HCL
54 lines
1.2 KiB
HCL
provider "aws" {}
|
|
|
|
resource "aws_instance" "example" {
|
|
ami = "ami-0d729a60"
|
|
instance_type = "t2.micro"
|
|
|
|
tags {
|
|
Name = "${terraform.env}.Example"
|
|
X-Project = "inspec"
|
|
}
|
|
}
|
|
|
|
resource "aws_iam_user" "mfa_not_enabled_user" {
|
|
name = "${terraform.env}.mfa_not_enabled_user"
|
|
}
|
|
|
|
resource "aws_iam_user" "console_password_enabled_user" {
|
|
name = "${terraform.env}.console_password_enabled_user"
|
|
force_destroy = true
|
|
}
|
|
|
|
resource "aws_iam_user_login_profile" "user_login_profile" {
|
|
user = "${aws_iam_user.console_password_enabled_user.name}"
|
|
pgp_key = "${var.login_profile_pgp_key}"
|
|
}
|
|
|
|
resource "aws_iam_user" "access_key_user" {
|
|
name = "${terraform.env}.access_key_user"
|
|
}
|
|
|
|
resource "aws_iam_access_key" "access_key" {
|
|
user = "${aws_iam_user.access_key_user.name}"
|
|
pgp_key = "${var.login_profile_pgp_key}"
|
|
}
|
|
|
|
output "mfa_not_enabled_user" {
|
|
value = "${aws_iam_user.mfa_not_enabled_user.name}"
|
|
}
|
|
|
|
output "console_password_enabled_user" {
|
|
value = "${aws_iam_user.console_password_enabled_user.name}"
|
|
}
|
|
|
|
output "access_key_user" {
|
|
value = "${aws_iam_user.access_key_user.name}"
|
|
}
|
|
|
|
output "example_ec2_name" {
|
|
value = "${aws_instance.example.tags.Name}"
|
|
}
|
|
|
|
output "example_ec2_id" {
|
|
value = "${aws_instance.example.id}"
|
|
}
|