forked from ansible-lockdown/RHEL9-CIS
changed to local file lookup
This commit is contained in:
parent
df2d812e6a
commit
b3cf41af6f
1 changed files with 6 additions and 1 deletions
7
.github/workflows/main.tf
vendored
7
.github/workflows/main.tf
vendored
|
|
@ -3,6 +3,11 @@ provider "aws" {
|
||||||
region = var.aws_region
|
region = var.aws_region
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read local file not created via terraform
|
||||||
|
data "local_file" "github_actions" {
|
||||||
|
filename = "${path.module}/${var.private_key}"
|
||||||
|
}
|
||||||
|
|
||||||
// Create a security group with access to port 22 and port 80 open to serve HTTP traffic
|
// Create a security group with access to port 22 and port 80 open to serve HTTP traffic
|
||||||
|
|
||||||
data "aws_vpc" "default" {
|
data "aws_vpc" "default" {
|
||||||
|
|
@ -66,7 +71,7 @@ resource "aws_instance" "testing_vm" {
|
||||||
# The default username for our AMI
|
# The default username for our AMI
|
||||||
user = var.ami_username
|
user = var.ami_username
|
||||||
# Private key for connection
|
# Private key for connection
|
||||||
private_key = file(".ssh/github_actions.pem")
|
private_key = data.local_file.github_actions.content
|
||||||
# Type of connection
|
# Type of connection
|
||||||
type = "ssh"
|
type = "ssh"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue