Menu

1 / 2

Day 97: A Policy Attached to Nothing and a Backup With No Data

DEV Community: terraform·Nnamdi Felix Ibe·3 days ago
#82LKzWFd
#devtoterraform#devto#dev#policy#database
Long article (1557 words) — no AI summary yet.
Reading 0:00
15s threshold

Day 97 of DevOps, Day 47 of Azure. Both tasks produced an artefact that is correct, verified, and confers nothing.

An IAM policy attached to no principal grants no permission to anybody. A database export with no data in it restores to an empty database. Both exist, both pass their checks, and neither does the thing its name implies.

One Terraform task, one Azure task. An IAM policy, then a SQL database exported to blob storage. The tasks come from the KodeKloud Engineer platform.

Task 1: An IAM policy in Terraform

A policy named iampolicy_javed , read-only access to the EC2 console, permitting three Describe actions.

Step 1: The configuration

resource "aws_iam_policy" "iampolicy_javed" { name = "iampolicy_javed" description = "Read-only access to EC2 console"

policy = jsonencode ( { Version = "2012-10-17" Statement = [ { Effect = "Allow" Action = [ "ec2:DescribeInstances" , "ec2:DescribeImages" , "ec2:DescribeSnapshots" ] Resource = "*" } ] } ) }

Enter fullscreen mode

Exit fullscreen mode

IAM…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.