# ------------------------------------------------------------------------ # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" file accompanying this file. This file is distributed # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. # ------------------------------------------------------------------------- # in this module, we create the necessary common resources for the integ-tests, this setup module will only need to be executed once. # vpc, iam role, security group, the number of those resources could be limited, creating them concurrently for every pr would trigger throttling issue. module "common" { source = "../common" } terraform { required_providers { aws = { source = "hashicorp/aws" version = "4.8.0" } } } provider "aws" { region = var.region } # create ssh key pair and upload them to s3 resource "tls_private_key" "ssh_key" { algorithm = "RSA" rsa_bits = 4096 } data "aws_caller_identity" "current" { } ## create one iam role for all the tests resource "aws_iam_instance_profile" "aoc_test_profile" { name = module.common.aoc_iam_role_name role = aws_iam_role.aoc_role.name } resource "aws_iam_role" "aoc_role" { name = module.common.aoc_iam_role_name path = "/" assume_role_policy = <