How Do I Pass Json File In Boto3
How do I pass json file as an argument in boto3? import boto3 client = boto3.client('route53') doc = open('policy.json', 'rb').read() response = client.create_traffic_policy(
Solution 1:
you can use the JSON library
import boto3
import json
client = boto3.client('route53')
doc = json.loads(open('cp.json', 'rb').read())
response = client.create_traffic_policy(
Name = 'test2',
Document = json.dumps(doc),
Comment = 'new traffic policy'
)
Post a Comment for "How Do I Pass Json File In Boto3"