-BNCEBपΓͷػೳ؆୯ʹݖݶΛઃఆ
Ͱ͖ΔɻΑΓએݴతͳهड़͕Մೳ
։ൃΛ࢝Ί͖͍ͯ᪴͢Ϧιʔεؒ*".
ϩʔϧͷݖݶΛࡉ͔͘؆୯ʹ࡞ΕΔʂ
3PMFपΓͷઃఆͰ໌ࣔతʹݖݶΛ༩͑
Δඞཁ͕͋Γগ͠खؒ
ٕज़બఆͷ؍ αʔόϨε
ࢀߟɿhttps://dev.classmethod.jp/articles/receive-data-from-soracom-on-aws-using-terraform/#toc-3 ࢀߟɿhttps://summit-online-japan-cdk.workshop.aws/20-typescript/40-hit-counter/600-permissions.html
resource aws_dynamodb_table iot_sample {
name = "Terraform_Iot_Sample"
…
}
…
resource "aws_iam_role" "role" {
name = "IotRuleToDynamoDBAccessRole"
assume_role_policy = = <}
resource "aws_iam_role_policy" "iam_policy_for_iot" {
…
policy = <"Action": [
"dynamodb:PutItem"
],
"Resource": “${aws_dynamodb_table.iot_sample.arn}"
}
}
EOF
}
export class HitCounter extends cdk.Construct {
…
const table = new dynamodb.Table(this, 'Hits', {
…
});
this.handler = new lambda.Function(this, 'HitCounterHandler', {
…
});
// grant the lambda role read/write permissions to our table
table.grantReadWriteData(this.handler);
}
}