public void GlacierSetVaultAccessPolicy() { #region to--set-the-access-policy-on-a-vault-1482185872517 var response = client.SetVaultAccessPolicy(new SetVaultAccessPolicyRequest { AccountId = "-", Policy = new VaultAccessPolicy { Policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Define-owner-access-rights\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::999999999999:root\"},\"Action\":\"glacier:DeleteArchive\",\"Resource\":\"arn:aws:glacier:us-west-2:999999999999:vaults/examplevault\"}]}" }, VaultName = "examplevault" }); #endregion }
private Amazon.Glacier.Model.SetVaultAccessPolicyResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.SetVaultAccessPolicyRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "SetVaultAccessPolicy"); try { #if DESKTOP return(client.SetVaultAccessPolicy(request)); #elif CORECLR return(client.SetVaultAccessPolicyAsync(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; } }