Show / Hide Table of Contents

Class PolicyAttachment

Provides an IoT policy attachment.

Example Usage

using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var pubsub = new Aws.Iot.Policy("pubsub", new Aws.Iot.PolicyArgs
    {
        Policy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
  ""Action"": [
    ""iot:*""
  ],
  ""Effect"": ""Allow"",
  ""Resource"": ""*""
}
]
}

",
    });
    var cert = new Aws.Iot.Certificate("cert", new Aws.Iot.CertificateArgs
    {
        Active = true,
        Csr = File.ReadAllText("csr.pem"),
    });
    var att = new Aws.Iot.PolicyAttachment("att", new Aws.Iot.PolicyAttachmentArgs
    {
        Policy = pubsub.Name,
        Target = cert.Arn,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
PolicyAttachment
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Iot
Assembly: Pulumi.Aws.dll
Syntax
public class PolicyAttachment : CustomResource

Constructors

View Source

PolicyAttachment(String, PolicyAttachmentArgs, CustomResourceOptions)

Create a PolicyAttachment resource with the given unique name, arguments, and options.

Declaration
public PolicyAttachment(string name, PolicyAttachmentArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

PolicyAttachmentArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Policy

The name of the policy to attach.

Declaration
public Output<string> Policy { get; }
Property Value
Type Description
Output<System.String>
View Source

Target

The identity to which the policy is attached.

Declaration
public Output<string> Target { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, PolicyAttachmentState, CustomResourceOptions)

Get an existing PolicyAttachment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static PolicyAttachment Get(string name, Input<string> id, PolicyAttachmentState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

PolicyAttachmentState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
PolicyAttachment
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.