Fugue.AWS.IAM.Policy

Module Members

new

(Function)

Policy Constructor

Call this constructor to create a new Fugue.AWS.IAM.Policy value. The Fugue.AWS.IAM.Policy type represents an inline policy that may be associated with one of the following:

  • Fugue.AWS.IAM.Group
  • Fugue.AWS.IAM.Role
  • Fugue.AWS.IAM.User

Example usage:

import Fugue.AWS.IAM as IAM

myPolicy: IAM.Policy.new {
  policyName: "my-policy",
  policyDocument: String.readFileUtf8("policy/my-policy.json")
}

anotherPolicy: IAM.Policy.new {
  policyName: "another-policy",
  policyDocument: '{
     "Version": "2012-10-17",
     "Statement": [
       {
         "Effect": "Allow",
         "Action": ["s3:ListBucket"],
         "Resource": ["arn:aws:s3:::test"]
       },
       {
        "Effect": "Allow",
         "Action": [
           "s3:GetObject",
         ],
         "Resource": ["arn:aws:s3:::test/*"]
       }
     ]
   }'
}

Type Signature

 fun { policyName: String,
       policyDocument: String} -> Policy
Argument: policyName

The name of the policy.

Type: String

Argument: policyDocument

The policy document in JSON format. See http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html for more details on the format of the document.

You may alternatively attach the policyDocument policy as an external JSON document, using the readFileUtf8() method. Files are relative to the directory in which the lwc compiler is run, unless an absolute path is specified.

Example usage: policyDocument: String.readFileUtf8(“policy/my-policy.json”)

Type: String

Returns:

A Fugue.AWS.IAM.Policy record.

Type: Policy

PolicySpec

(Type)

type PolicySpec:
  policyName: String
  policyDocument: String

DEPRECATED IAM Policy Specification

This type specifies an IAM policy, a set of permissions that can be applied to identities (users, groups, and roles) or resources.

Record {

Field: policyName

The name of the policy.

Type: String

Field: policyDocument

The policy document in JSON format. See http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html for more details on the format of the document.

You may alternatively attach the policyDocument policy as an external JSON document, using the readFileUtf8() method. Files are relative to the directory in which the lwc compiler is run, unless an absolute path is specified.

Example usage: policyDocument: String.readFileUtf8(“policy/my-policy.json”)

Type: String

}