payload: {"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-cdk/issues/4292","repository_url":"https://api.github.com/repos/aws/aws-cdk","labels_url":"https://api.github.com/repos/aws/aws-cdk/issues/4292/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-cdk/issues/4292/comments","events_url":"https://api.github.com/repos/aws/aws-cdk/issues/4292/events","html_url":"https://github.com/aws/aws-cdk/issues/4292","id":500266000,"node_id":"MDU6SXNzdWU1MDAyNjYwMDA=","number":4292,"title":"AwsCustomResource cannot access resources in other regions","user":{"login":"konstantinj","id":4353187,"node_id":"MDQ6VXNlcjQzNTMxODc=","avatar_url":"https://avatars3.githubusercontent.com/u/4353187?v=4","gravatar_id":"","url":"https://api.github.com/users/konstantinj","html_url":"https://github.com/konstantinj","followers_url":"https://api.github.com/users/konstantinj/followers","following_url":"https://api.github.com/users/konstantinj/following{/other_user}","gists_url":"https://api.github.com/users/konstantinj/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantinj/subscriptions","organizations_url":"https://api.github.com/users/konstantinj/orgs","repos_url":"https://api.github.com/users/konstantinj/repos","events_url":"https://api.github.com/users/konstantinj/events{/privacy}","received_events_url":"https://api.github.com/users/konstantinj/received_events","type":"User","site_admin":false},"labels":[{"id":1110651955,"node_id":"MDU6TGFiZWwxMTEwNjUxOTU1","url":"https://api.github.com/repos/aws/aws-cdk/labels/feature-request","name":"feature-request","color":"008672","default":false},{"id":1063660916,"node_id":"MDU6TGFiZWwxMDYzNjYwOTE2","url":"https://api.github.com/repos/aws/aws-cdk/labels/package/cdk-core","name":"package/cdk-core","color":"fbb334","default":false},{"id":1548469115,"node_id":"MDU6TGFiZWwxNTQ4NDY5MTE1","url":"https://api.github.com/repos/aws/aws-cdk/labels/status/in-progress","name":"status/in-progress","color":"ffe79b","default":false}],"state":"open","locked":false,"assignee":{"login":"eladb","id":598796,"node_id":"MDQ6VXNlcjU5ODc5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/598796?v=4","gravatar_id":"","url":"https://api.github.com/users/eladb","html_url":"https://github.com/eladb","followers_url":"https://api.github.com/users/eladb/followers","following_url":"https://api.github.com/users/eladb/following{/other_user}","gists_url":"https://api.github.com/users/eladb/gists{/gist_id}","starred_url":"https://api.github.com/users/eladb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eladb/subscriptions","organizations_url":"https://api.github.com/users/eladb/orgs","repos_url":"https://api.github.com/users/eladb/repos","events_url":"https://api.github.com/users/eladb/events{/privacy}","received_events_url":"https://api.github.com/users/eladb/received_events","type":"User","site_admin":false},"assignees":[{"login":"eladb","id":598796,"node_id":"MDQ6VXNlcjU5ODc5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/598796?v=4","gravatar_id":"","url":"https://api.github.com/users/eladb","html_url":"https://github.com/eladb","followers_url":"https://api.github.com/users/eladb/followers","following_url":"https://api.github.com/users/eladb/following{/other_user}","gists_url":"https://api.github.com/users/eladb/gists{/gist_id}","starred_url":"https://api.github.com/users/eladb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eladb/subscriptions","organizations_url":"https://api.github.com/users/eladb/orgs","repos_url":"https://api.github.com/users/eladb/repos","events_url":"https://api.github.com/users/eladb/events{/privacy}","received_events_url":"https://api.github.com/users/eladb/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2019-09-30T13:08:18Z","updated_at":"2019-10-02T07:52:23Z","closed_at":null,"author_association":"NONE","body":"I've tried using AwsCustomResource to publish to a sns topic in a different region. It fails with the error \"Invalid parameter: TopicArn\". When I try the same with awscli I get the same error.\r\n\r\nIt looks like that could be solved by letting the lambda function use the region where the sns topic is located. Unfortunately I see no way of either changing the lambda function on the fly or setting AWS_DEFAULT_REGION as environment variable to it.\r\n\r\nIt would be great if lambda could \"guess\" which region to use by analysing the parameters. But being able to provide the proper region would be enough for me.\r\n\r\n### Reproduction Steps\r\n\r\nCreate an sns topic in region A and give permission to be accessed by others\r\n\r\n```typescript\r\nexport class BaseStack extends cdk.Stack {\r\n    testTopic: sns.ITopic\r\n\r\n    constructor(app: cdk.App, id: string, props?: cdk.StackProps) {\r\n        super(app, id, props)\r\n\r\n        this.testTopic = new sns.Topic(this, \"TestTopic\", {\r\n            topicName: \"test\",\r\n            displayName: \"test\"\r\n        });\r\n\r\n        let policy = new iam.PolicyStatement()\r\n        policy.addAnyPrincipal()\r\n        policy.addAllResources()\r\n        policy.addActions(\"sns:Publish\")\r\n\r\n        this.testTopic.addToResourcePolicy(policy)\r\n    }\r\n}\r\n```\r\n\r\nCreate the custom resource in region B\r\n\r\n```typescript\r\nexport class TestStack extends cdk.Stack {\r\n\r\n    constructor(app: cdk.App, id: string, props?: cdk.StackProps) {\r\n        super(app, id, props)\r\n\r\n        const snsPublish = new custom.AwsCustomResource(this, \"SnsPublish\", {\r\n            onUpdate: {\r\n                service: \"SNS\",\r\n                action: \"publish\",\r\n                parameters: {\r\n                    Message: \"Hello From another region\",\r\n                    TopicArn: \"arn:aws:sns:eu-west-1:XXXXXXXXXXXX:test\",\r\n                },\r\n                physicalResourceId: \"test\",\r\n            },\r\n        });\r\n    }\r\n}\r\n```\r\n\r\n### Environment\r\n\r\n  - **CDK CLI Version:** 1.9.0 (build 30f158a)\r\n  - **Module Version:** 1.9.0\r\n  - **OS:** all\r\n  - **Language:** TypeScript"},"comment":{"url":"https://api.github.com/repos/aws/aws-cdk/issues/comments/537379805","html_url":"https://github.com/aws/aws-cdk/issues/4292#issuecomment-537379805","issue_url":"https://api.github.com/repos/aws/aws-cdk/issues/4292","id":537379805,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNzM3OTgwNQ==","user":{"login":"eladb","id":598796,"node_id":"MDQ6VXNlcjU5ODc5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/598796?v=4","gravatar_id":"","url":"https://api.github.com/users/eladb","html_url":"https://github.com/eladb","followers_url":"https://api.github.com/users/eladb/followers","following_url":"https://api.github.com/users/eladb/following{/other_user}","gists_url":"https://api.github.com/users/eladb/gists{/gist_id}","starred_url":"https://api.github.com/users/eladb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eladb/subscriptions","organizations_url":"https://api.github.com/users/eladb/orgs","repos_url":"https://api.github.com/users/eladb/repos","events_url":"https://api.github.com/users/eladb/events{/privacy}","received_events_url":"https://api.github.com/users/eladb/received_events","type":"User","site_admin":false},"created_at":"2019-10-02T07:52:23Z","updated_at":"2019-10-02T07:52:23Z","author_association":"CONTRIBUTOR","body":"Also commented on the PR: I am not sure this is a good idea. What is the use case exactly? It's generally considered an anti-pattern to perform cross region operations. If users wish to invoke APIs in a region, they can just create a CFN stack in that region."}}
other: {"actor":{"display_login":"eladb"}}