locals { environment_vars = { "HTTP_PROXY" = "http://${var.proxy}" "HTTPS_PROXY" = "http://${var.proxy}" "NO_PROXY" = "${var.dns_info["legacy_private"]["zone"]},${var.dns_info["private"]["zone"]}" "VAULT_HOST" = "vault.${var.dns_info["private"]["zone"]}" "VAULT_PATH" = "portal/data/lambda_sync_env" "VERIFY_PORTAL_SSL" = "0" "PYTHONWARNINGS" = "ignore:Unverified HTTPS request" } } data "aws_iam_policy_document" "policy_portal_data_sync_lambda" { statement { effect = "Allow" actions = [ "ec2:CreateNetworkInterface", "logs:CreateLogStream", "ec2:DescribeNetworkInterfaces", "logs:DescribeLogStreams", "ec2:DeleteNetworkInterface", "logs:PutRetentionPolicy", "logs:CreateLogGroup", "logs:PutLogEvents" ] resources = ["*"] } } resource "aws_iam_policy" "policy_portal_data_sync_lambda" { name = "policy_portal_data_sync_lambda" path = "/" policy = data.aws_iam_policy_document.policy_portal_data_sync_lambda.json description = "IAM policy for portal_data_sync_lambda" } resource "aws_iam_role" "portal-lambda-role" { name = "portal-data-sync-lambda-role" assume_role_policy = <