I am working on AWS organization : currently creating scp policies under AWS organization as below:
Python file:
policies = config['policies']
for policy in policies:
try:
OUPolicy = client.create_policy(
Description=policy['description'],
Name= policy['Name'],
Content=policy['content'],
Type='SERVICE_CONTROL_POLICY'
)
YAML file:
policies:
- Name: xyz
description: Service Control Policies for xyz
content:
Version: 2012-10-17
Statement:
- Effect: Allow
Resource: "*"
Action: "*"
- Effect: Deny
Resource: "*"
Action: "*
I verified the YAML template and It is in proper format but still getting error as below:
Parameter validation failed:
Invalid type for parameter Content, value: {'Version': datetime.date(2012, 10, 17), 'Statement': [{'Effect': 'Allow', 'Resource': '*', 'Action': '*'}, {'Effect': 'Deny', 'Resource': '*', 'Action': '*'}]}, type: <class 'dict'>, valid types: <class 'str'>