getTopic

suspend fun getTopic(argument: GetTopicPlainArgs): GetTopicResult

Use this data source to get the ARN of a topic in AWS Simple Notification Service (SNS). By using this data source, you can reference SNS topics without having to hard code the ARNs as input.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sns.SnsFunctions;
import com.pulumi.aws.sns.inputs.GetTopicArgs;
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) {
final var example = SnsFunctions.getTopic(GetTopicArgs.builder()
.name("an_example_topic")
.build());
}
}

Return

A collection of values returned by getTopic.

Parameters

argument

A collection of arguments for invoking getTopic.


suspend fun getTopic(name: String): GetTopicResult

Return

A collection of values returned by getTopic.

Parameters

name

Friendly name of the topic to match.

See also


suspend fun getTopic(argument: suspend GetTopicPlainArgsBuilder.() -> Unit): GetTopicResult

Return

A collection of values returned by getTopic.

Parameters

argument

Builder for com.pulumi.aws.sns.kotlin.inputs.GetTopicPlainArgs.

See also