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": "*" + } + ] +}