Skip to content

Commit

Permalink
fix(aws): fix aws_instance test
Browse files Browse the repository at this point in the history
  • Loading branch information
alikhajeh1 committed Jul 23, 2021
1 parent bd06505 commit 429efc4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// AWS provider is locked due to https://github.com/hashicorp/terraform-provider-aws/issues/20287
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.50.0"
}
}
}

provider "aws" {
region = "us-east-1" # <<<<< Try changing this to eu-west-1 to compare the costs
skip_credentials_validation = true
Expand Down
1 change: 1 addition & 0 deletions examples/terraform/plan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"format_version":"0.2","terraform_version":"1.0.2","planned_values":{"root_module":{"resources":[{"address":"aws_instance.web_app","mode":"managed","type":"aws_instance","name":"web_app","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"ami":"ami-674cbc1e","credit_specification":[],"disable_api_termination":null,"ebs_block_device":[{"delete_on_termination":true,"device_name":"my_data","iops":800,"tags":null,"volume_size":1000,"volume_type":"io1"}],"ebs_optimized":null,"get_password_data":false,"hibernation":null,"iam_instance_profile":null,"instance_type":"m5.4xlarge","monitoring":null,"root_block_device":[{"delete_on_termination":true,"tags":null,"volume_size":50}],"source_dest_check":true,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null,"volume_tags":null},"sensitive_values":{"capacity_reservation_specification":[],"credit_specification":[],"ebs_block_device":[{}],"enclave_options":[],"ephemeral_block_device":[],"ipv6_addresses":[],"metadata_options":[],"network_interface":[],"root_block_device":[{}],"secondary_private_ips":[],"security_groups":[],"tags_all":{},"vpc_security_group_ids":[]}},{"address":"aws_lambda_function.hello_world","mode":"managed","type":"aws_lambda_function","name":"hello_world","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"code_signing_config_arn":null,"dead_letter_config":[],"description":null,"environment":[],"file_system_config":[],"filename":null,"function_name":"hello_world","handler":"exports.test","image_config":[],"image_uri":null,"kms_key_arn":null,"layers":null,"memory_size":1024,"package_type":"Zip","publish":false,"reserved_concurrent_executions":-1,"role":"arn:aws:lambda:us-east-1:account-id:resource-id","runtime":"nodejs12.x","s3_bucket":null,"s3_key":null,"s3_object_version":null,"tags":null,"timeout":3,"timeouts":null,"vpc_config":[]},"sensitive_values":{"dead_letter_config":[],"environment":[],"file_system_config":[],"image_config":[],"tags_all":{},"tracing_config":[],"vpc_config":[]}}]}},"resource_changes":[{"address":"aws_instance.web_app","mode":"managed","type":"aws_instance","name":"web_app","provider_name":"registry.terraform.io/hashicorp/aws","change":{"actions":["create"],"before":null,"after":{"ami":"ami-674cbc1e","credit_specification":[],"disable_api_termination":null,"ebs_block_device":[{"delete_on_termination":true,"device_name":"my_data","iops":800,"tags":null,"volume_size":1000,"volume_type":"io1"}],"ebs_optimized":null,"get_password_data":false,"hibernation":null,"iam_instance_profile":null,"instance_type":"m5.4xlarge","monitoring":null,"root_block_device":[{"delete_on_termination":true,"tags":null,"volume_size":50}],"source_dest_check":true,"tags":null,"timeouts":null,"user_data":null,"user_data_base64":null,"volume_tags":null},"after_unknown":{"arn":true,"associate_public_ip_address":true,"availability_zone":true,"capacity_reservation_specification":true,"cpu_core_count":true,"cpu_threads_per_core":true,"credit_specification":[],"ebs_block_device":[{"encrypted":true,"kms_key_id":true,"snapshot_id":true,"throughput":true,"volume_id":true}],"enclave_options":true,"ephemeral_block_device":true,"host_id":true,"id":true,"instance_initiated_shutdown_behavior":true,"instance_state":true,"ipv6_address_count":true,"ipv6_addresses":true,"key_name":true,"metadata_options":true,"network_interface":true,"outpost_arn":true,"password_data":true,"placement_group":true,"primary_network_interface_id":true,"private_dns":true,"private_ip":true,"public_dns":true,"public_ip":true,"root_block_device":[{"device_name":true,"encrypted":true,"iops":true,"kms_key_id":true,"throughput":true,"volume_id":true,"volume_type":true}],"secondary_private_ips":true,"security_groups":true,"subnet_id":true,"tags_all":true,"tenancy":true,"vpc_security_group_ids":true},"before_sensitive":false,"after_sensitive":{"capacity_reservation_specification":[],"credit_specification":[],"ebs_block_device":[{}],"enclave_options":[],"ephemeral_block_device":[],"ipv6_addresses":[],"metadata_options":[],"network_interface":[],"root_block_device":[{}],"secondary_private_ips":[],"security_groups":[],"tags_all":{},"vpc_security_group_ids":[]}}},{"address":"aws_lambda_function.hello_world","mode":"managed","type":"aws_lambda_function","name":"hello_world","provider_name":"registry.terraform.io/hashicorp/aws","change":{"actions":["create"],"before":null,"after":{"code_signing_config_arn":null,"dead_letter_config":[],"description":null,"environment":[],"file_system_config":[],"filename":null,"function_name":"hello_world","handler":"exports.test","image_config":[],"image_uri":null,"kms_key_arn":null,"layers":null,"memory_size":1024,"package_type":"Zip","publish":false,"reserved_concurrent_executions":-1,"role":"arn:aws:lambda:us-east-1:account-id:resource-id","runtime":"nodejs12.x","s3_bucket":null,"s3_key":null,"s3_object_version":null,"tags":null,"timeout":3,"timeouts":null,"vpc_config":[]},"after_unknown":{"arn":true,"dead_letter_config":[],"environment":[],"file_system_config":[],"id":true,"image_config":[],"invoke_arn":true,"last_modified":true,"qualified_arn":true,"signing_job_arn":true,"signing_profile_version_arn":true,"source_code_hash":true,"source_code_size":true,"tags_all":true,"tracing_config":true,"version":true,"vpc_config":[]},"before_sensitive":false,"after_sensitive":{"dead_letter_config":[],"environment":[],"file_system_config":[],"image_config":[],"tags_all":{},"tracing_config":[],"vpc_config":[]}}}],"configuration":{"provider_config":{"aws":{"name":"aws","version_constraint":"3.50.0","expressions":{"access_key":{"constant_value":"mock_access_key"},"region":{"constant_value":"us-east-1"},"secret_key":{"constant_value":"mock_secret_key"},"skip_credentials_validation":{"constant_value":true},"skip_requesting_account_id":{"constant_value":true}}}},"root_module":{"resources":[{"address":"aws_instance.web_app","mode":"managed","type":"aws_instance","name":"web_app","provider_config_key":"aws","expressions":{"ami":{"constant_value":"ami-674cbc1e"},"ebs_block_device":[{"device_name":{"constant_value":"my_data"},"iops":{"constant_value":800},"volume_size":{"constant_value":1000},"volume_type":{"constant_value":"io1"}}],"instance_type":{"constant_value":"m5.4xlarge"},"root_block_device":[{"volume_size":{"constant_value":50}}]},"schema_version":1},{"address":"aws_lambda_function.hello_world","mode":"managed","type":"aws_lambda_function","name":"hello_world","provider_config_key":"aws","expressions":{"function_name":{"constant_value":"hello_world"},"handler":{"constant_value":"exports.test"},"memory_size":{"constant_value":1024},"role":{"constant_value":"arn:aws:lambda:us-east-1:account-id:resource-id"},"runtime":{"constant_value":"nodejs12.x"}},"schema_version":0}]}}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

// AWS provider is locked due to https://github.com/hashicorp/terraform-provider-aws/issues/20287
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.50.0"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
Expand Down
1 change: 1 addition & 0 deletions internal/providers/terraform/tftest/tftest.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var tfProviders = `
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.50.0"
}
google = {
source = "hashicorp/google"
Expand Down

0 comments on commit 429efc4

Please sign in to comment.