Amazon.IoT.AmazonIoTClient.CreatePolicy C# (CSharp) Method

CreatePolicy() public method

Creates an AWS IoT policy.

The created policy is the default version for the policy. This operation creates a policy version with a version identifier of 1 and sets 1 as the policy's default version.

/// An unexpected error has occurred. /// /// The request is not valid. /// /// The policy documentation is not valid. /// /// The resource already exists. /// /// The service is temporarily unavailable. /// /// The rate exceeds the limit. /// /// You are not authorized to perform this operation. ///
public CreatePolicy ( string policyName, string policyDocument ) : Amazon.IoT.Model.CreatePolicyResponse
policyName string The policy name.
policyDocument string The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
return Amazon.IoT.Model.CreatePolicyResponse
        public CreatePolicyResponse CreatePolicy(string policyName, string policyDocument)
        {
            var request = new CreatePolicyRequest();
            request.PolicyName = policyName;
            request.PolicyDocument = policyDocument;
            return CreatePolicy(request);
        }

Same methods

AmazonIoTClient::CreatePolicy ( CreatePolicyRequest request ) : Amazon.IoT.Model.CreatePolicyResponse
AmazonIoTClient