Dan Van Brunt
10/13/2021, 3:30 PMStaticSite is giving the CF Distro access to the bucket? In our CFN we normally create a CF OAI and then give it read access to the bucket to that only the distro can and there is no direct access to the bucket. Seems like you have this working in StaticSite…. but I can’t see anything that sets this up? Is this maybe a sane default of cdk?Frank
Frank
"FrontendBucketPolicyB05AF112": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Ref": "FrontendBucket5DAC5524"
},
"PolicyDocument": {
"Statement": [
...
{
"Action": "s3:GetObject",
"Effect": "Allow",
"Principal": {
"CanonicalUser": {
"Fn::GetAtt": [
"FrontendDistributionOrigin1S3Origin0C7BC470",
"S3CanonicalUserId"
]
}
},
"Resource": {
"Fn::Join": [
"",
[
{
"Fn::GetAtt": [
"FrontendBucket5DAC5524",
"Arn"
]
},
"/*"
]
]
}
}
],
"Version": "2012-10-17"
}
},
"Metadata": {
"aws:cdk:path": "dev-playground-site/Frontend/Bucket/Policy/Resource"
}
},Dan Van Brunt
10/13/2021, 4:48 PMDan Van Brunt
10/13/2021, 4:49 PM"FrontendDistributionOrigin1S3Origin0C7BC470",
"S3CanonicalUserId"
for use elsewhere.Dan Van Brunt
10/13/2021, 4:52 PMDan Van Brunt
10/13/2021, 4:57 PM“You can construct tokens representing synth-time lazy values using static methods on theclass, such as Lazy.stringValue (Python:Lazy) and Lazy.numberValue (Python:Lazy.string_value. These methods accept an object whoseLazy.number_valueproperty is a function that accepts a context argument and returns the final value when called.”produce
Frank
Stack.resolve(origins)? (replied in the other thread)Dan Van Brunt
10/13/2021, 5:01 PMorigins from this… ?
const cfDistribution = this.cfDistribution.node.defaultChild as cf.CfnDistributionDan Van Brunt
10/13/2021, 5:01 PMDan Van Brunt
10/13/2021, 5:01 PMthis.cfDistribution.node.findChild('origins') but no luckFrank
Stack.resolve(this.cfDistribution) ?Dan Van Brunt
10/13/2021, 5:02 PMDan Van Brunt
10/13/2021, 5:03 PM*cdk*.Stack.resolve(this.cfDistribution) I assumeDan Van Brunt
10/13/2021, 5:04 PMFrank
Dan Van Brunt
10/13/2021, 5:05 PMDan Van Brunt
10/13/2021, 5:05 PM