From 0e86b912bd99776d802877033b27e44660e2ec2b Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Wed, 13 May 2020 15:08:20 +0200 Subject: [PATCH] policy and data template --- project8/base.tf | 12 ++++++++++++ project8/policy.json | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 project8/base.tf create mode 100644 project8/policy.json diff --git a/project8/base.tf b/project8/base.tf new file mode 100644 index 0000000..1a72084 --- /dev/null +++ b/project8/base.tf @@ -0,0 +1,12 @@ +provider "aws" { + region = "eu-west-2" +} + +data "template_file" "template1" { + template = file("./policy.json") +} + +resource "aws_iam_policy" "policy" { + name = "cedric-policy1" + policy = data.template_file.template1.rendered +} diff --git a/project8/policy.json b/project8/policy.json new file mode 100644 index 0000000..18bef0d --- /dev/null +++ b/project8/policy.json @@ -0,0 +1,11 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": "ec2:*", + "Resource": "*" + } + ] +}