Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi
gcp.pubsub.getTopic
Explore with Pulumi AI
Get information about a Google Cloud Pub/Sub Topic. For more information see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my-pubsub-topic = gcp.pubsub.getTopic({
name: "my-pubsub-topic",
});
import pulumi
import pulumi_gcp as gcp
my_pubsub_topic = gcp.pubsub.get_topic(name="my-pubsub-topic")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pubsub.LookupTopic(ctx, &pubsub.LookupTopicArgs{
Name: "my-pubsub-topic",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_pubsub_topic = Gcp.PubSub.GetTopic.Invoke(new()
{
Name = "my-pubsub-topic",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.PubsubFunctions;
import com.pulumi.gcp.pubsub.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 my-pubsub-topic = PubsubFunctions.getTopic(GetTopicArgs.builder()
.name("my-pubsub-topic")
.build());
}
}
variables:
my-pubsub-topic:
fn::invoke:
Function: gcp:pubsub:getTopic
Arguments:
name: my-pubsub-topic
Using getTopic
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTopic(args: GetTopicArgs, opts?: InvokeOptions): Promise<GetTopicResult>
function getTopicOutput(args: GetTopicOutputArgs, opts?: InvokeOptions): Output<GetTopicResult>
def get_topic(name: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTopicResult
def get_topic_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTopicResult]
func LookupTopic(ctx *Context, args *LookupTopicArgs, opts ...InvokeOption) (*LookupTopicResult, error)
func LookupTopicOutput(ctx *Context, args *LookupTopicOutputArgs, opts ...InvokeOption) LookupTopicResultOutput
> Note: This function is named LookupTopic
in the Go SDK.
public static class GetTopic
{
public static Task<GetTopicResult> InvokeAsync(GetTopicArgs args, InvokeOptions? opts = null)
public static Output<GetTopicResult> Invoke(GetTopicInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:pubsub/getTopic:getTopic
arguments:
# arguments dictionary
The following arguments are supported:
getTopic Result
The following output properties are available:
- Effective
Labels Dictionary<string, string> - Id string
- The provider-assigned unique ID for this managed resource.
- Ingestion
Data List<GetSource Settings Topic Ingestion Data Source Setting> - Kms
Key stringName - Labels Dictionary<string, string>
- Message
Retention stringDuration - Message
Storage List<GetPolicies Topic Message Storage Policy> - Name string
- Pulumi
Labels Dictionary<string, string> - Schema
Settings List<GetTopic Schema Setting> - Project string
- Effective
Labels map[string]string - Id string
- The provider-assigned unique ID for this managed resource.
- Ingestion
Data []GetSource Settings Topic Ingestion Data Source Setting - Kms
Key stringName - Labels map[string]string
- Message
Retention stringDuration - Message
Storage []GetPolicies Topic Message Storage Policy - Name string
- Pulumi
Labels map[string]string - Schema
Settings []GetTopic Schema Setting - Project string
- effective
Labels Map<String,String> - id String
- The provider-assigned unique ID for this managed resource.
- ingestion
Data List<GetSource Settings Topic Ingestion Data Source Setting> - kms
Key StringName - labels Map<String,String>
- message
Retention StringDuration - message
Storage List<GetPolicies Topic Message Storage Policy> - name String
- pulumi
Labels Map<String,String> - schema
Settings List<GetTopic Schema Setting> - project String
- effective
Labels {[key: string]: string} - id string
- The provider-assigned unique ID for this managed resource.
- ingestion
Data GetSource Settings Topic Ingestion Data Source Setting[] - kms
Key stringName - labels {[key: string]: string}
- message
Retention stringDuration - message
Storage GetPolicies Topic Message Storage Policy[] - name string
- pulumi
Labels {[key: string]: string} - schema
Settings GetTopic Schema Setting[] - project string
- effective_
labels Mapping[str, str] - id str
- The provider-assigned unique ID for this managed resource.
- ingestion_
data_ Sequence[Getsource_ settings Topic Ingestion Data Source Setting] - kms_
key_ strname - labels Mapping[str, str]
- message_
retention_ strduration - message_
storage_ Sequence[Getpolicies Topic Message Storage Policy] - name str
- pulumi_
labels Mapping[str, str] - schema_
settings Sequence[GetTopic Schema Setting] - project str
- effective
Labels Map<String> - id String
- The provider-assigned unique ID for this managed resource.
- ingestion
Data List<Property Map>Source Settings - kms
Key StringName - labels Map<String>
- message
Retention StringDuration - message
Storage List<Property Map>Policies - name String
- pulumi
Labels Map<String> - schema
Settings List<Property Map> - project String
Supporting Types
GetTopicIngestionDataSourceSetting
- Aws
Kineses List<GetTopic Ingestion Data Source Setting Aws Kinese> - Settings for ingestion from Amazon Kinesis Data Streams.
- Aws
Kineses []GetTopic Ingestion Data Source Setting Aws Kinese - Settings for ingestion from Amazon Kinesis Data Streams.
- aws
Kineses List<GetTopic Ingestion Data Source Setting Aws Kinese> - Settings for ingestion from Amazon Kinesis Data Streams.
- aws
Kineses GetTopic Ingestion Data Source Setting Aws Kinese[] - Settings for ingestion from Amazon Kinesis Data Streams.
- aws_
kineses Sequence[GetTopic Ingestion Data Source Setting Aws Kinese] - Settings for ingestion from Amazon Kinesis Data Streams.
- aws
Kineses List<Property Map> - Settings for ingestion from Amazon Kinesis Data Streams.
GetTopicIngestionDataSourceSettingAwsKinese
- Aws
Role stringArn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- Consumer
Arn string - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- Gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- Stream
Arn string - The Kinesis stream ARN to ingest data from.
- Aws
Role stringArn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- Consumer
Arn string - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- Gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- Stream
Arn string - The Kinesis stream ARN to ingest data from.
- aws
Role StringArn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- consumer
Arn String - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- gcp
Service StringAccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- stream
Arn String - The Kinesis stream ARN to ingest data from.
- aws
Role stringArn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- consumer
Arn string - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- stream
Arn string - The Kinesis stream ARN to ingest data from.
- aws_
role_ strarn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- consumer_
arn str - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- gcp_
service_ straccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- stream_
arn str - The Kinesis stream ARN to ingest data from.
- aws
Role StringArn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- consumer
Arn String - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- gcp
Service StringAccount - The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
- stream
Arn String - The Kinesis stream ARN to ingest data from.
GetTopicMessageStoragePolicy
- Allowed
Persistence List<string>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- Allowed
Persistence []stringRegions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence List<String>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence string[]Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed_
persistence_ Sequence[str]regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence List<String>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
GetTopicSchemaSetting
- Encoding string
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- Schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- Encoding string
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- Schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding String
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- schema String
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding string
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding str
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- schema str
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding String
- The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
- schema String
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.