github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticache/getCluster.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package elasticache 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Use this data source to get information about an ElastiCache Cluster 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := elasticache.LookupCluster(ctx, &elasticache.LookupClusterArgs{ 32 // ClusterId: "my-cluster-id", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupClusterResult 46 err := ctx.Invoke("aws:elasticache/getCluster:getCluster", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getCluster. 54 type LookupClusterArgs struct { 55 // Group identifier. 56 ClusterId string `pulumi:"clusterId"` 57 // Tags assigned to the resource 58 Tags map[string]string `pulumi:"tags"` 59 } 60 61 // A collection of values returned by getCluster. 62 type LookupClusterResult struct { 63 Arn string `pulumi:"arn"` 64 // Availability Zone for the cache cluster. 65 AvailabilityZone string `pulumi:"availabilityZone"` 66 // List of node objects including `id`, `address`, `port`, `availabilityZone` and `outpostArn`. 67 // Referenceable e.g., as `${data.aws_elasticache_cluster.bar.cache_nodes.0.address}` 68 CacheNodes []GetClusterCacheNode `pulumi:"cacheNodes"` 69 // (Memcached only) DNS name of the cache cluster without the port appended. 70 ClusterAddress string `pulumi:"clusterAddress"` 71 ClusterId string `pulumi:"clusterId"` 72 // (Memcached only) Configuration endpoint to allow host discovery. 73 ConfigurationEndpoint string `pulumi:"configurationEndpoint"` 74 // Name of the cache engine. 75 Engine string `pulumi:"engine"` 76 // Version number of the cache engine. 77 EngineVersion string `pulumi:"engineVersion"` 78 // The provider-assigned unique ID for this managed resource. 79 Id string `pulumi:"id"` 80 // The IP version advertised in the discovery protocol. 81 IpDiscovery string `pulumi:"ipDiscovery"` 82 // Redis [SLOWLOG](https://redis.io/commands/slowlog) or Redis [Engine Log](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log) delivery settings. 83 LogDeliveryConfigurations []GetClusterLogDeliveryConfiguration `pulumi:"logDeliveryConfigurations"` 84 // Specifies the weekly time range for when maintenance 85 // on the cache cluster is performed. 86 MaintenanceWindow string `pulumi:"maintenanceWindow"` 87 // The IP versions for cache cluster connections. 88 NetworkType string `pulumi:"networkType"` 89 // The cluster node type. 90 NodeType string `pulumi:"nodeType"` 91 // An ARN of an 92 // SNS topic that ElastiCache notifications get sent to. 93 NotificationTopicArn string `pulumi:"notificationTopicArn"` 94 // The number of cache nodes that the cache cluster has. 95 NumCacheNodes int `pulumi:"numCacheNodes"` 96 // Name of the parameter group associated with this cache cluster. 97 ParameterGroupName string `pulumi:"parameterGroupName"` 98 // The port number on which each of the cache nodes will 99 // accept connections. 100 Port int `pulumi:"port"` 101 // The outpost ARN in which the cache cluster was created if created in outpost. 102 PreferredOutpostArn string `pulumi:"preferredOutpostArn"` 103 // The replication group to which this cache cluster belongs. 104 ReplicationGroupId string `pulumi:"replicationGroupId"` 105 // List VPC security groups associated with the cache cluster. 106 SecurityGroupIds []string `pulumi:"securityGroupIds"` 107 // The number of days for which ElastiCache will 108 // retain automatic cache cluster snapshots before deleting them. 109 SnapshotRetentionLimit int `pulumi:"snapshotRetentionLimit"` 110 // Daily time range (in UTC) during which ElastiCache will 111 // begin taking a daily snapshot of the cache cluster. 112 SnapshotWindow string `pulumi:"snapshotWindow"` 113 // Name of the subnet group associated to the cache cluster. 114 SubnetGroupName string `pulumi:"subnetGroupName"` 115 // Tags assigned to the resource 116 Tags map[string]string `pulumi:"tags"` 117 } 118 119 func LookupClusterOutput(ctx *pulumi.Context, args LookupClusterOutputArgs, opts ...pulumi.InvokeOption) LookupClusterResultOutput { 120 return pulumi.ToOutputWithContext(context.Background(), args). 121 ApplyT(func(v interface{}) (LookupClusterResult, error) { 122 args := v.(LookupClusterArgs) 123 r, err := LookupCluster(ctx, &args, opts...) 124 var s LookupClusterResult 125 if r != nil { 126 s = *r 127 } 128 return s, err 129 }).(LookupClusterResultOutput) 130 } 131 132 // A collection of arguments for invoking getCluster. 133 type LookupClusterOutputArgs struct { 134 // Group identifier. 135 ClusterId pulumi.StringInput `pulumi:"clusterId"` 136 // Tags assigned to the resource 137 Tags pulumi.StringMapInput `pulumi:"tags"` 138 } 139 140 func (LookupClusterOutputArgs) ElementType() reflect.Type { 141 return reflect.TypeOf((*LookupClusterArgs)(nil)).Elem() 142 } 143 144 // A collection of values returned by getCluster. 145 type LookupClusterResultOutput struct{ *pulumi.OutputState } 146 147 func (LookupClusterResultOutput) ElementType() reflect.Type { 148 return reflect.TypeOf((*LookupClusterResult)(nil)).Elem() 149 } 150 151 func (o LookupClusterResultOutput) ToLookupClusterResultOutput() LookupClusterResultOutput { 152 return o 153 } 154 155 func (o LookupClusterResultOutput) ToLookupClusterResultOutputWithContext(ctx context.Context) LookupClusterResultOutput { 156 return o 157 } 158 159 func (o LookupClusterResultOutput) Arn() pulumi.StringOutput { 160 return o.ApplyT(func(v LookupClusterResult) string { return v.Arn }).(pulumi.StringOutput) 161 } 162 163 // Availability Zone for the cache cluster. 164 func (o LookupClusterResultOutput) AvailabilityZone() pulumi.StringOutput { 165 return o.ApplyT(func(v LookupClusterResult) string { return v.AvailabilityZone }).(pulumi.StringOutput) 166 } 167 168 // List of node objects including `id`, `address`, `port`, `availabilityZone` and `outpostArn`. 169 // Referenceable e.g., as `${data.aws_elasticache_cluster.bar.cache_nodes.0.address}` 170 func (o LookupClusterResultOutput) CacheNodes() GetClusterCacheNodeArrayOutput { 171 return o.ApplyT(func(v LookupClusterResult) []GetClusterCacheNode { return v.CacheNodes }).(GetClusterCacheNodeArrayOutput) 172 } 173 174 // (Memcached only) DNS name of the cache cluster without the port appended. 175 func (o LookupClusterResultOutput) ClusterAddress() pulumi.StringOutput { 176 return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterAddress }).(pulumi.StringOutput) 177 } 178 179 func (o LookupClusterResultOutput) ClusterId() pulumi.StringOutput { 180 return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterId }).(pulumi.StringOutput) 181 } 182 183 // (Memcached only) Configuration endpoint to allow host discovery. 184 func (o LookupClusterResultOutput) ConfigurationEndpoint() pulumi.StringOutput { 185 return o.ApplyT(func(v LookupClusterResult) string { return v.ConfigurationEndpoint }).(pulumi.StringOutput) 186 } 187 188 // Name of the cache engine. 189 func (o LookupClusterResultOutput) Engine() pulumi.StringOutput { 190 return o.ApplyT(func(v LookupClusterResult) string { return v.Engine }).(pulumi.StringOutput) 191 } 192 193 // Version number of the cache engine. 194 func (o LookupClusterResultOutput) EngineVersion() pulumi.StringOutput { 195 return o.ApplyT(func(v LookupClusterResult) string { return v.EngineVersion }).(pulumi.StringOutput) 196 } 197 198 // The provider-assigned unique ID for this managed resource. 199 func (o LookupClusterResultOutput) Id() pulumi.StringOutput { 200 return o.ApplyT(func(v LookupClusterResult) string { return v.Id }).(pulumi.StringOutput) 201 } 202 203 // The IP version advertised in the discovery protocol. 204 func (o LookupClusterResultOutput) IpDiscovery() pulumi.StringOutput { 205 return o.ApplyT(func(v LookupClusterResult) string { return v.IpDiscovery }).(pulumi.StringOutput) 206 } 207 208 // Redis [SLOWLOG](https://redis.io/commands/slowlog) or Redis [Engine Log](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log) delivery settings. 209 func (o LookupClusterResultOutput) LogDeliveryConfigurations() GetClusterLogDeliveryConfigurationArrayOutput { 210 return o.ApplyT(func(v LookupClusterResult) []GetClusterLogDeliveryConfiguration { return v.LogDeliveryConfigurations }).(GetClusterLogDeliveryConfigurationArrayOutput) 211 } 212 213 // Specifies the weekly time range for when maintenance 214 // on the cache cluster is performed. 215 func (o LookupClusterResultOutput) MaintenanceWindow() pulumi.StringOutput { 216 return o.ApplyT(func(v LookupClusterResult) string { return v.MaintenanceWindow }).(pulumi.StringOutput) 217 } 218 219 // The IP versions for cache cluster connections. 220 func (o LookupClusterResultOutput) NetworkType() pulumi.StringOutput { 221 return o.ApplyT(func(v LookupClusterResult) string { return v.NetworkType }).(pulumi.StringOutput) 222 } 223 224 // The cluster node type. 225 func (o LookupClusterResultOutput) NodeType() pulumi.StringOutput { 226 return o.ApplyT(func(v LookupClusterResult) string { return v.NodeType }).(pulumi.StringOutput) 227 } 228 229 // An ARN of an 230 // SNS topic that ElastiCache notifications get sent to. 231 func (o LookupClusterResultOutput) NotificationTopicArn() pulumi.StringOutput { 232 return o.ApplyT(func(v LookupClusterResult) string { return v.NotificationTopicArn }).(pulumi.StringOutput) 233 } 234 235 // The number of cache nodes that the cache cluster has. 236 func (o LookupClusterResultOutput) NumCacheNodes() pulumi.IntOutput { 237 return o.ApplyT(func(v LookupClusterResult) int { return v.NumCacheNodes }).(pulumi.IntOutput) 238 } 239 240 // Name of the parameter group associated with this cache cluster. 241 func (o LookupClusterResultOutput) ParameterGroupName() pulumi.StringOutput { 242 return o.ApplyT(func(v LookupClusterResult) string { return v.ParameterGroupName }).(pulumi.StringOutput) 243 } 244 245 // The port number on which each of the cache nodes will 246 // accept connections. 247 func (o LookupClusterResultOutput) Port() pulumi.IntOutput { 248 return o.ApplyT(func(v LookupClusterResult) int { return v.Port }).(pulumi.IntOutput) 249 } 250 251 // The outpost ARN in which the cache cluster was created if created in outpost. 252 func (o LookupClusterResultOutput) PreferredOutpostArn() pulumi.StringOutput { 253 return o.ApplyT(func(v LookupClusterResult) string { return v.PreferredOutpostArn }).(pulumi.StringOutput) 254 } 255 256 // The replication group to which this cache cluster belongs. 257 func (o LookupClusterResultOutput) ReplicationGroupId() pulumi.StringOutput { 258 return o.ApplyT(func(v LookupClusterResult) string { return v.ReplicationGroupId }).(pulumi.StringOutput) 259 } 260 261 // List VPC security groups associated with the cache cluster. 262 func (o LookupClusterResultOutput) SecurityGroupIds() pulumi.StringArrayOutput { 263 return o.ApplyT(func(v LookupClusterResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput) 264 } 265 266 // The number of days for which ElastiCache will 267 // retain automatic cache cluster snapshots before deleting them. 268 func (o LookupClusterResultOutput) SnapshotRetentionLimit() pulumi.IntOutput { 269 return o.ApplyT(func(v LookupClusterResult) int { return v.SnapshotRetentionLimit }).(pulumi.IntOutput) 270 } 271 272 // Daily time range (in UTC) during which ElastiCache will 273 // begin taking a daily snapshot of the cache cluster. 274 func (o LookupClusterResultOutput) SnapshotWindow() pulumi.StringOutput { 275 return o.ApplyT(func(v LookupClusterResult) string { return v.SnapshotWindow }).(pulumi.StringOutput) 276 } 277 278 // Name of the subnet group associated to the cache cluster. 279 func (o LookupClusterResultOutput) SubnetGroupName() pulumi.StringOutput { 280 return o.ApplyT(func(v LookupClusterResult) string { return v.SubnetGroupName }).(pulumi.StringOutput) 281 } 282 283 // Tags assigned to the resource 284 func (o LookupClusterResultOutput) Tags() pulumi.StringMapOutput { 285 return o.ApplyT(func(v LookupClusterResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 286 } 287 288 func init() { 289 pulumi.RegisterOutputType(LookupClusterResultOutput{}) 290 }