field_level_encryption_config = {
'CallerReference': 'unique_reference_string',
'FieldLevelEncryptionConfig': {
'FieldLevelEncryptionProfileConfig': {
'Name': 'profile_name',
'CallerReference': 'unique_reference_string',
'EncryptionEntities': {
'Quantity': 1,
'Items': [
{
'PublicKeyId': 'public_key_id',
'ProviderId': 'provider_id'
}
]
}
},
'ContentTypeProfileConfig': {
'ForwardWhenContentTypeIsUnknown': False,
'ContentTypeProfiles': {
'Quantity': 1,
'Items': [
{
'Format': 'URLEncoded',
'ProfileId': 'profile_id',
'ContentType': 'content_type'
}
]
}
}
}
}
response = client.update_distribution(
DistributionConfig={
'CallerReference': 'unique_reference_string',
'Aliases': {
'Quantity': 1,
'Items': [
'example.com'
]
},
'DefaultRootObject': 'index.html',
'Origins': {
'Quantity': 1,
'Items': [
{
'Id': 'unique_id',
'DomainName': 'example.com',
'OriginPath': '',
'CustomHeaders': {
'Quantity': 0
},
'S3OriginConfig': {
'OriginAccessIdentity': ''
},
'CustomOriginConfig': {
'HTTPPort': 80,
'HTTPSPort': 443,
'OriginProtocolPolicy': 'https-only',
'OriginSslProtocols': {
'Quantity': 3,
'Items': [
'TLSv1',
'TLSv1.1',
'TLSv1.2'
]
}
}
}
]
},
'DefaultCacheBehavior': {
'TargetOriginId': 'unique_id',
'ForwardedValues': {
'QueryString': False,
'Cookies': {
'Forward': 'none'
},
'Headers': {
'Quantity': 0
},
'QueryStringCacheKeys': {
'Quantity': 0
}
},
'TrustedSigners': {
'Enabled': False,
'Quantity': 0
},
'ViewerProtocolPolicy': 'redirect-to-https',
'MinTTL': 0,
'AllowedMethods': {
'Quantity': 2,
'Items': [
'GET',
'HEAD'
],
'CachedMethods': {
'Quantity': 2,
'Items': [
'GET',
'HEAD'
]
}
},
'SmoothStreaming': False,
'DefaultTTL': 86400,
'MaxTTL': 31536000,
'Compress': False,
'LambdaFunctionAssociations': {
'Quantity': 0
}
},
'CacheBehaviors': {
'Quantity': 0
},
'CustomErrorResponses': {
'Quantity': 0
},
'Comment': '',
'Logging': {
'Enabled': False,
'IncludeCookies': False,
'Bucket': '',
'Prefix': ''
},
'PriceClass': 'PriceClass_All',
'Enabled': True,
'ViewerCertificate': {
'CloudFrontDefaultCertificate': True,
'MinimumProtocolVersion': 'TLSv1',
'CertificateSource': 'cloudfront'
},
'Restrictions': {
'GeoRestriction': {
'RestrictionType': 'none',
'Quantity': 0
}
},
'WebACLId': '',
'HttpVersion': 'http2',
'IsIPV6Enabled': True,
'FieldLevelEncryption': field_level_encryption_config
},
Id=distribution_id,
IfMatch=response['ETag']
)