com.pulumi.aws.backup.VaultNotifications Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.backup;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.backup.VaultNotificationsArgs;
import com.pulumi.aws.backup.inputs.VaultNotificationsState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;
/**
* Provides an AWS Backup vault notifications resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.sns.Topic;
* import com.pulumi.aws.sns.TopicArgs;
* import com.pulumi.aws.iam.IamFunctions;
* import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
* import com.pulumi.aws.sns.TopicPolicy;
* import com.pulumi.aws.sns.TopicPolicyArgs;
* import com.pulumi.aws.backup.VaultNotifications;
* import com.pulumi.aws.backup.VaultNotificationsArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var testTopic = new Topic("testTopic", TopicArgs.builder()
* .name("backup-vault-events")
* .build());
*
* final var test = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
* .policyId("__default_policy_ID")
* .statements(GetPolicyDocumentStatementArgs.builder()
* .actions("SNS:Publish")
* .effect("Allow")
* .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
* .type("Service")
* .identifiers("backup.amazonaws.com")
* .build())
* .resources(testTopic.arn())
* .sid("__default_statement_ID")
* .build())
* .build());
*
* var testTopicPolicy = new TopicPolicy("testTopicPolicy", TopicPolicyArgs.builder()
* .arn(testTopic.arn())
* .policy(test.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(test -> test.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
* .build());
*
* var testVaultNotifications = new VaultNotifications("testVaultNotifications", VaultNotificationsArgs.builder()
* .backupVaultName("example_backup_vault")
* .snsTopicArn(testTopic.arn())
* .backupVaultEvents(
* "BACKUP_JOB_STARTED",
* "RESTORE_JOB_COMPLETED")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import Backup vault notifications using the `name`. For example:
*
* ```sh
* $ pulumi import aws:backup/vaultNotifications:VaultNotifications test TestVault
* ```
*
*/
@ResourceType(type="aws:backup/vaultNotifications:VaultNotifications")
public class VaultNotifications extends com.pulumi.resources.CustomResource {
/**
* The ARN of the vault.
*
*/
@Export(name="backupVaultArn", refs={String.class}, tree="[0]")
private Output backupVaultArn;
/**
* @return The ARN of the vault.
*
*/
public Output backupVaultArn() {
return this.backupVaultArn;
}
/**
* An array of events that indicate the status of jobs to back up resources to the backup vault.
*
*/
@Export(name="backupVaultEvents", refs={List.class,String.class}, tree="[0,1]")
private Output> backupVaultEvents;
/**
* @return An array of events that indicate the status of jobs to back up resources to the backup vault.
*
*/
public Output> backupVaultEvents() {
return this.backupVaultEvents;
}
/**
* Name of the backup vault to add notifications for.
*
*/
@Export(name="backupVaultName", refs={String.class}, tree="[0]")
private Output backupVaultName;
/**
* @return Name of the backup vault to add notifications for.
*
*/
public Output backupVaultName() {
return this.backupVaultName;
}
/**
* The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events
*
*/
@Export(name="snsTopicArn", refs={String.class}, tree="[0]")
private Output snsTopicArn;
/**
* @return The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events
*
*/
public Output snsTopicArn() {
return this.snsTopicArn;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public VaultNotifications(java.lang.String name) {
this(name, VaultNotificationsArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public VaultNotifications(java.lang.String name, VaultNotificationsArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public VaultNotifications(java.lang.String name, VaultNotificationsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:backup/vaultNotifications:VaultNotifications", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private VaultNotifications(java.lang.String name, Output id, @Nullable VaultNotificationsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:backup/vaultNotifications:VaultNotifications", name, state, makeResourceOptions(options, id), false);
}
private static VaultNotificationsArgs makeArgs(VaultNotificationsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? VaultNotificationsArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static VaultNotifications get(java.lang.String name, Output id, @Nullable VaultNotificationsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new VaultNotifications(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy