Skip to content

Commit

Permalink
Merge branch 'koneru9999-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed Jul 6, 2020
2 parents 935aba6 + 607ace9 commit 6d284fa
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG
** Please Note the following **
* `ec2.CustomerGateway.bgpAsn` has changed from an `int` to `string` to allow 4-byte ASNs
* Add `C5A` instance type family to `aws.ec2.InstanceTypes`.
* Add the ability to specify aws.queue.QueuePolicy `policy` as iam.PolicyDocument

---

Expand Down
18 changes: 18 additions & 0 deletions provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -118727,6 +118727,15 @@
"inputProperties": {
"policy": {
"type": "string",
"oneOf": [
{
"type": "string"
},
{
"type": "string",
"$ref": "#/types/aws:iam/documents:PolicyDocument"
}
],
"description": "The JSON policy for the SQS queue.\n"
},
"queueUrl": {
Expand All @@ -118743,6 +118752,15 @@
"properties": {
"policy": {
"type": "string",
"oneOf": [
{
"type": "string"
},
{
"type": "string",
"$ref": "#/types/aws:iam/documents:PolicyDocument"
}
],
"description": "The JSON policy for the SQS queue.\n"
},
"queueUrl": {
Expand Down
11 changes: 10 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,16 @@ func Provider() tfbridge.ProviderInfo {
"name": tfbridge.AutoName("name", 80),
},
},
"aws_sqs_queue_policy": {Tok: awsResource(sqsMod, "QueuePolicy")},
"aws_sqs_queue_policy": {
Tok: awsResource(sqsMod, "QueuePolicy"),
Fields: map[string]*tfbridge.SchemaInfo{
"policy": {
Type: "string",
AltTypes: []tokens.Type{awsType(iamMod, "documents", "PolicyDocument")},
Transform: tfbridge.TransformJSONDocument,
},
},
},
// Storage Gateway
"aws_storagegateway_gateway": {Tok: awsResource(storagegatewayMod, "Gateway")},
"aws_storagegateway_cache": {Tok: awsResource(storagegatewayMod, "Cache")},
Expand Down
4 changes: 2 additions & 2 deletions sdk/go/aws/sqs/queuePolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ func (QueuePolicyState) ElementType() reflect.Type {

type queuePolicyArgs struct {
// The JSON policy for the SQS queue.
Policy string `pulumi:"policy"`
Policy interface{} `pulumi:"policy"`
// The URL of the SQS Queue to which to attach the policy
QueueUrl string `pulumi:"queueUrl"`
}

// The set of arguments for constructing a QueuePolicy resource.
type QueuePolicyArgs struct {
// The JSON policy for the SQS queue.
Policy pulumi.StringInput
Policy pulumi.Input
// The URL of the SQS Queue to which to attach the policy
QueueUrl pulumi.StringInput
}
Expand Down
6 changes: 4 additions & 2 deletions sdk/nodejs/sqs/queuePolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";

import {PolicyDocument} from "../iam";

/**
* Allows you to set a policy of an SQS Queue
* while referencing ARN of the queue within the policy.
Expand Down Expand Up @@ -119,7 +121,7 @@ export interface QueuePolicyState {
/**
* The JSON policy for the SQS queue.
*/
readonly policy?: pulumi.Input<string>;
readonly policy?: pulumi.Input<string | PolicyDocument>;
/**
* The URL of the SQS Queue to which to attach the policy
*/
Expand All @@ -133,7 +135,7 @@ export interface QueuePolicyArgs {
/**
* The JSON policy for the SQS queue.
*/
readonly policy: pulumi.Input<string>;
readonly policy: pulumi.Input<string | PolicyDocument>;
/**
* The URL of the SQS Queue to which to attach the policy
*/
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/pulumi_aws/sqs/queue_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(__self__, resource_name, opts=None, policy=None, queue_url=None, __
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] policy: The JSON policy for the SQS queue.
:param pulumi.Input[dict] policy: The JSON policy for the SQS queue.
:param pulumi.Input[str] queue_url: The URL of the SQS Queue to which to attach the policy
"""
if __name__ is not None:
Expand Down Expand Up @@ -97,7 +97,7 @@ def get(resource_name, id, opts=None, policy=None, queue_url=None):
:param str resource_name: The unique name of the resulting resource.
:param str id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] policy: The JSON policy for the SQS queue.
:param pulumi.Input[dict] policy: The JSON policy for the SQS queue.
:param pulumi.Input[str] queue_url: The URL of the SQS Queue to which to attach the policy
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
Expand Down

0 comments on commit 6d284fa

Please sign in to comment.