private addAccessControl()

in infra/stack/greengrass/components/sample-logger-componet-construct.ts [88:111]


    private addAccessControl(components: any, ggComponent: gg2.CfnComponentVersion, iotRuleTopic: string) {
        const topicWild = `${iotRuleTopic}/#`;

        components[this.compName] = {
            componentVersion: ggComponent.attrComponentVersion,
            configurationUpdate: {
                merge: JSON.stringify({
                    "accessControl": {
                        "aws.greengrass.ipc.mqttproxy": {
                            "sample-logger:mqttproxy:1": {
                                "policyDescription": "Allows access to publish to IoTCore",
                                "operations": [
                                    "aws.greengrass#PublishToIoTCore"
                                ],
                                "resources": [
                                    topicWild
                                ]
                            }
                        }
                    }
                })
            }
        };
    }