示例#1
0
        public void OrganizationsAttachPolicy()
        {
            #region to-attach-a-policy-to-an-ou

            var response = client.AttachPolicy(new AttachPolicyRequest
            {
                PolicyId = "p-examplepolicyid111",
                TargetId = "ou-examplerootid111-exampleouid111"
            });


            #endregion
        }
示例#2
0
 private Amazon.Organizations.Model.AttachPolicyResponse CallAWSServiceOperation(IAmazonOrganizations client, Amazon.Organizations.Model.AttachPolicyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Organizations", "AttachPolicy");
     try
     {
         #if DESKTOP
         return(client.AttachPolicy(request));
         #elif CORECLR
         return(client.AttachPolicyAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }