sparse-intern-71089
06/21/2019, 7:31 PMcool-egg-852
06/21/2019, 7:32 PMwhite-balloon-205
policy: pulumi.output({ ... })
. That means it’s still mostly strongly typed.white-balloon-205
broad-dog-22463
06/21/2019, 7:33 PMbroad-dog-22463
06/21/2019, 7:34 PMwhite-balloon-205
{ ... }
adheres to the PolicyDocument
interface.white-balloon-205
policy: pulumi.Input<string | PolicyDocument>;
cool-egg-852
06/21/2019, 7:37 PMwhite-balloon-205
string
(as @cool-egg-852 did originally) or a PolicyDocument
which is a strongly typed object.white-balloon-205
the whole input/output thing always bites usWe are continuing to do work to try to make this simpler in Pulumi. There are typically just a few common patterns that can be used to cover most cases, but we do want to find ways to remove more friction here.
cool-egg-852
06/21/2019, 7:40 PMwhite-balloon-205
const awsIamPolicy = new aws.iam.Policy('rsin-provider', {
name: `${config.environment}-rsin-provider`,
description: 'Allow rsin-provider to connect to ElasticSearch',
policy: pulumi.output({
Version: '2012-10-17',
Statement: [
{
Action: ['es:*'],
Effect: 'Allow',
Resource: pulumi.interpolate`${elasticSearchDomain.arn}/*`
},
{
Effect: 'Allow',
Action: ['dynamodb:DescribeTable', 'dynamodb:Query', 'dynamodb:Scan'],
Resource: clientsTable.arn
},
{
Effect: 'Allow',
Action: ['dynamodb:DescribeTable', 'dynamodb:Query', 'dynamodb:Scan'],
Resource: auditLogsTable.arn
},
{
Effect: 'Allow',
Action: ['dynamodb:DescribeTable', 'dynamodb:Query', 'dynamodb:Scan'],
Resource: linksTable.arn
},
{
Effect: 'Allow',
Action: ['dynamodb:DescribeTable', 'dynamodb:Query', 'dynamodb:Scan'],
Resource: notificationsTable.arn
},
{
Effect: 'Allow',
Action: ['dynamodb:DescribeTable', 'dynamodb:Query', 'dynamodb:Scan'],
Resource: usersTable.arn
}
]
})
});
cool-egg-852
06/21/2019, 7:43 PMwhite-balloon-205
@pulumi/aws
- this may not work.white-balloon-205
@pulumi/aws
. With the latest - the code above works.cool-egg-852
06/21/2019, 7:44 PMcool-egg-852
06/21/2019, 7:45 PMcool-egg-852
06/21/2019, 7:45 PMwhite-balloon-205
cool-egg-852
06/21/2019, 7:46 PM