amazonka-iam-1.6.1: Amazon Identity and Access Management SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.IAM.CreatePolicy

Contents

Description

Creates a new managed policy for your AWS account.

This operation creates a policy version with a version identifier of v1 and sets v1 as the policy's default version. For more information about policy versions, see Versioning for Managed Policies in the IAM User Guide .

For more information about managed policies in general, see Managed Policies and Inline Policies in the IAM User Guide .

Synopsis

Creating a Request

createPolicy Source #

Creates a value of CreatePolicy with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • cpPath - The path for the policy. For more information about paths, see IAM Identifiers in the IAM User Guide . This parameter is optional. If it is not included, it defaults to a slash (). This parameter allows (per its <http:wikipedia.orgwikiregex regex pattern> ) a string of characters consisting of either a forward slash () by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (u0021) through the DEL character (u007F), including most punctuation characters, digits, and upper and lowercased letters.
  • cpDescription - A friendly description of the policy. Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables." The policy description is immutable. After a value is assigned, it cannot be changed.
  • cpPolicyName - The friendly name of the policy. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
  • cpPolicyDocument - The JSON policy document that you want to use as the content for the new policy. The regex pattern used to validate this parameter is a string of characters consisting of the following: * Any printable ASCII character ranging from the space character (u0020) through the end of the ASCII character range * The printable characters in the Basic Latin and Latin-1 Supplement character set (through u00FF) * The special characters tab (u0009), line feed (u000A), and carriage return (u000D)

data CreatePolicy Source #

See: createPolicy smart constructor.

Instances
Eq CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Data CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreatePolicy -> c CreatePolicy #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreatePolicy #

toConstr :: CreatePolicy -> Constr #

dataTypeOf :: CreatePolicy -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CreatePolicy) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreatePolicy) #

gmapT :: (forall b. Data b => b -> b) -> CreatePolicy -> CreatePolicy #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreatePolicy -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreatePolicy -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreatePolicy -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreatePolicy -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreatePolicy -> m CreatePolicy #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreatePolicy -> m CreatePolicy #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreatePolicy -> m CreatePolicy #

Read CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Show CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Generic CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Associated Types

type Rep CreatePolicy :: Type -> Type #

Hashable CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

AWSRequest CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Associated Types

type Rs CreatePolicy :: Type #

ToHeaders CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

ToPath CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

ToQuery CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

NFData CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Methods

rnf :: CreatePolicy -> () #

type Rep CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

type Rep CreatePolicy = D1 (MetaData "CreatePolicy" "Network.AWS.IAM.CreatePolicy" "amazonka-iam-1.6.1-BDjAp2BAcQu3GSS4Bsr6zu" False) (C1 (MetaCons "CreatePolicy'" PrefixI True) ((S1 (MetaSel (Just "_cpPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_cpDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_cpPolicyName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_cpPolicyDocument") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs CreatePolicy Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Request Lenses

cpPath :: Lens' CreatePolicy (Maybe Text) Source #

The path for the policy. For more information about paths, see IAM Identifiers in the IAM User Guide . This parameter is optional. If it is not included, it defaults to a slash (). This parameter allows (per its <http:wikipedia.orgwikiregex regex pattern> ) a string of characters consisting of either a forward slash () by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (u0021) through the DEL character (u007F), including most punctuation characters, digits, and upper and lowercased letters.

cpDescription :: Lens' CreatePolicy (Maybe Text) Source #

A friendly description of the policy. Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables." The policy description is immutable. After a value is assigned, it cannot be changed.

cpPolicyName :: Lens' CreatePolicy Text Source #

The friendly name of the policy. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

cpPolicyDocument :: Lens' CreatePolicy Text Source #

The JSON policy document that you want to use as the content for the new policy. The regex pattern used to validate this parameter is a string of characters consisting of the following: * Any printable ASCII character ranging from the space character (u0020) through the end of the ASCII character range * The printable characters in the Basic Latin and Latin-1 Supplement character set (through u00FF) * The special characters tab (u0009), line feed (u000A), and carriage return (u000D)

Destructuring the Response

createPolicyResponse Source #

Creates a value of CreatePolicyResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data CreatePolicyResponse Source #

Contains the response to a successful CreatePolicy request.

See: createPolicyResponse smart constructor.

Instances
Eq CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Data CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreatePolicyResponse -> c CreatePolicyResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreatePolicyResponse #

toConstr :: CreatePolicyResponse -> Constr #

dataTypeOf :: CreatePolicyResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CreatePolicyResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreatePolicyResponse) #

gmapT :: (forall b. Data b => b -> b) -> CreatePolicyResponse -> CreatePolicyResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreatePolicyResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreatePolicyResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreatePolicyResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreatePolicyResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreatePolicyResponse -> m CreatePolicyResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreatePolicyResponse -> m CreatePolicyResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreatePolicyResponse -> m CreatePolicyResponse #

Read CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Show CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Generic CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Associated Types

type Rep CreatePolicyResponse :: Type -> Type #

NFData CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

Methods

rnf :: CreatePolicyResponse -> () #

type Rep CreatePolicyResponse Source # 
Instance details

Defined in Network.AWS.IAM.CreatePolicy

type Rep CreatePolicyResponse = D1 (MetaData "CreatePolicyResponse" "Network.AWS.IAM.CreatePolicy" "amazonka-iam-1.6.1-BDjAp2BAcQu3GSS4Bsr6zu" False) (C1 (MetaCons "CreatePolicyResponse'" PrefixI True) (S1 (MetaSel (Just "_cprsPolicy") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Policy)) :*: S1 (MetaSel (Just "_cprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

Response Lenses

cprsPolicy :: Lens' CreatePolicyResponse (Maybe Policy) Source #

A structure containing details about the new policy.

cprsResponseStatus :: Lens' CreatePolicyResponse Int Source #

  • - | The response status code.