Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Jun 3, 2024
1 parent 8f9133c commit bc04da9
Show file tree
Hide file tree
Showing 22 changed files with 333 additions and 75 deletions.
11 changes: 1 addition & 10 deletions src/coverage/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,7 @@ Datasource percentage coverage 99.81
./resource.ps1 aws_ssoadmin_permission_set_inline_policy
./resource.ps1 aws_ssoadmin_permissions_boundary_attachment
./resource.ps1 aws_ssoadmin_trusted_token_issuer
./resource.ps1 aws_storagegateway_cache
./resource.ps1 aws_storagegateway_cached_iscsi_volume
./resource.ps1 aws_storagegateway_file_system_association
./resource.ps1 aws_storagegateway_gateway
./resource.ps1 aws_storagegateway_nfs_file_share
./resource.ps1 aws_storagegateway_smb_file_share
./resource.ps1 aws_storagegateway_stored_iscsi_volume
./resource.ps1 aws_storagegateway_tape_pool
./resource.ps1 aws_storagegateway_upload_buffer
./resource.ps1 aws_storagegateway_working_storage

./resource.ps1 aws_synthetics_canary
./resource.ps1 aws_synthetics_group
./resource.ps1 aws_synthetics_group_association
Expand Down
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_gateway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_nfs_file_share.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_smb_file_share.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_tape_pool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_upload_buffer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/aws_storagegateway_working_storage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
52 changes: 52 additions & 0 deletions terraform/aws/aws_storagegateway_cache.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
resource "aws_storagegateway_cache" "pike" {
disk_id = data.aws_storagegateway_local_disk.test.id
gateway_arn = aws_storagegateway_gateway.pike.arn
}

data "aws_storagegateway_local_disk" "test" {
disk_node = aws_volume_attachment.test.device_name
gateway_arn = aws_storagegateway_gateway.pike.arn
}

resource "aws_volume_attachment" "test" {
device_name = "/dev/xvdb"
volume_id = aws_ebs_volume.test.id
instance_id = aws_instance.test.id
}

data "aws_ami" "ubuntu" {
most_recent = true

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

owners = ["099720109477"] # Canonical
}

resource "aws_instance" "test" {
ami = data.aws_ami.ubuntu.id
instance_type = "t3.micro"

tags = {
Name = "HelloWorld"
}
}


resource "aws_ebs_volume" "test" {
availability_zone = "eu-west-2a"
size = 50
encrypted = true
type = "gp3"
# tags = {
# Name = "HelloWorld"
# pike="permissions"
# }
}
6 changes: 6 additions & 0 deletions terraform/aws/aws_storagegateway_cached_iscsi_volume.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "aws_storagegateway_cached_iscsi_volume" "pike" {
gateway_arn = aws_storagegateway_cache.pike.gateway_arn
network_interface_id = aws_instance.test.private_ip
target_name = "example"
volume_size_in_bytes = 5368709120 # 5 GB
}
19 changes: 19 additions & 0 deletions terraform/aws/aws_storagegateway_file_system_association.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "aws_storagegateway_file_system_association" "pike" {
gateway_arn = aws_storagegateway_gateway.pike.arn
location_arn = aws_fsx_windows_file_system.pike.arn
username = "Admin"
password = "avoid-plaintext-passwords"
audit_destination_arn = aws_s3_bucket.example.arn
tags = {
pike = "permission"
}
}

resource "aws_fsx_windows_file_system" "pike" {
subnet_ids = [data.aws_subnets.example.ids[0]]
throughput_capacity = 8
}

data "aws_subnets" "example" {

}
15 changes: 15 additions & 0 deletions terraform/aws/aws_storagegateway_gateway.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "aws_storagegateway_gateway" "pike" {
gateway_ip_address = "1.2.3.4"
gateway_name = "example"
gateway_timezone = "GMT"
gateway_type = "FILE_FSX_SMB"
smb_active_directory_settings {
domain_name = "corp.example.com"
password = "avoid-plaintext-passwords"
username = "Admin"
}

tags = {
pike = "permissions"
}
}
9 changes: 9 additions & 0 deletions terraform/aws/aws_storagegateway_nfs_file_share.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_storagegateway_nfs_file_share" "pike" {
client_list = ["0.0.0.0/0"]
gateway_arn = aws_storagegateway_gateway.pike.arn
location_arn = aws_s3_bucket.example.arn
role_arn = aws_iam_role.example.arn
tags = {
pike = "permissions"
}
}
30 changes: 30 additions & 0 deletions terraform/aws/aws_storagegateway_smb_file_share.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "aws_storagegateway_smb_file_share" "pike" {
authentication = "ActiveDirectory"
gateway_arn = aws_storagegateway_gateway.pike.arn
location_arn = aws_s3_bucket.example.arn
role_arn = aws_iam_role.example.arn
tags = {
pike = "permissions"
}
}

resource "aws_s3_bucket" "example" {
bucket = "totalguffjgw"
}

resource "aws_iam_role" "example" {
assume_role_policy = jsonencode(
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : { "AWS" : "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root" },
"Action" : "sts:AssumeRole",
}
]
}
)
}

data "aws_caller_identity" "current" {}
10 changes: 10 additions & 0 deletions terraform/aws/aws_storagegateway_stored_iscsi_volume.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "aws_storagegateway_stored_iscsi_volume" "pike" {
gateway_arn = aws_storagegateway_cache.pike.gateway_arn
network_interface_id = aws_instance.test.private_ip
target_name = "example"
preserve_existing_data = false
disk_id = data.aws_storagegateway_local_disk.test.id
tags = {
pike = "permissions"
}
}
7 changes: 7 additions & 0 deletions terraform/aws/aws_storagegateway_tape_pool.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "aws_storagegateway_tape_pool" "pike" {
pool_name = "example"
storage_class = "GLACIER"
tags = {
pike = "permissions"
}
}
4 changes: 4 additions & 0 deletions terraform/aws/aws_storagegateway_upload_buffer.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "aws_storagegateway_upload_buffer" "pike" {
disk_path = data.aws_storagegateway_local_disk.test.disk_path
gateway_arn = aws_storagegateway_gateway.pike.arn
}
4 changes: 4 additions & 0 deletions terraform/aws/aws_storagegateway_working_storage.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "aws_storagegateway_working_storage" "pike" {
disk_id = data.aws_storagegateway_local_disk.test.id
gateway_arn = aws_storagegateway_gateway.pike.arn
}
Loading

0 comments on commit bc04da9

Please sign in to comment.