1. Packages
  2. Packages
  3. Defang Providers
  4. API Docs
  5. Redis
Viewing docs for Defang GCP v2.4.1
published on Saturday, Jul 11, 2026 by Defang
defang-gcp logo
Viewing docs for Defang GCP v2.4.1
published on Saturday, Jul 11, 2026 by Defang

    Create Redis Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Redis(name: string, args?: RedisArgs, opts?: ComponentResourceOptions);
    @overload
    def Redis(resource_name: str,
              args: Optional[RedisArgs] = None,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Redis(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              deploy: Optional[_compose.DeployConfigArgs] = None,
              image: Optional[str] = None,
              ports: Optional[Sequence[_compose.ServicePortConfigArgs]] = None,
              redis: Optional[_compose.RedisConfigArgs] = None)
    func NewRedis(ctx *Context, name string, args *RedisArgs, opts ...ResourceOption) (*Redis, error)
    public Redis(string name, RedisArgs? args = null, ComponentResourceOptions? opts = null)
    public Redis(String name, RedisArgs args)
    public Redis(String name, RedisArgs args, ComponentResourceOptions options)
    
    type: defang-gcp:Redis
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "defang-gcp_redis" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RedisArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RedisArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RedisArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RedisArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RedisArgs
    The arguments to resource properties.
    options ComponentResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var redisResource = new DefangGcp.Redis("redisResource", new()
    {
        Deploy = new DefangGcp.Compose.Inputs.DeployConfigArgs
        {
            Replicas = 0,
            Resources = new DefangGcp.Compose.Inputs.ResourcesArgs
            {
                Reservations = new DefangGcp.Compose.Inputs.ResourceConfigArgs
                {
                    Cpus = 0,
                    Memory = "string",
                },
            },
        },
        Image = "string",
        Ports = new[]
        {
            new DefangGcp.Compose.Inputs.ServicePortConfigArgs
            {
                Target = 0,
                AppProtocol = "string",
                Listener = "string",
                Mode = "string",
                Protocol = "string",
            },
        },
        Redis = new DefangGcp.Compose.Inputs.RedisConfigArgs
        {
            AllowDowntime = false,
            FromSnapshot = "string",
        },
    });
    
    example, err := defanggcp.NewRedis(ctx, "redisResource", &defanggcp.RedisArgs{
    	Deploy: &compose.DeployConfigArgs{
    		Replicas: pulumi.Int(0),
    		Resources: &compose.ResourcesArgs{
    			Reservations: &compose.ResourceConfigArgs{
    				Cpus:   pulumi.Float64(0),
    				Memory: pulumi.String("string"),
    			},
    		},
    	},
    	Image: "string",
    	Ports: compose.ServicePortConfigArray{
    		&compose.ServicePortConfigArgs{
    			Target:      pulumi.Int(0),
    			AppProtocol: pulumi.String("string"),
    			Listener:    pulumi.String("string"),
    			Mode:        pulumi.String("string"),
    			Protocol:    pulumi.String("string"),
    		},
    	},
    	Redis: &compose.RedisConfigArgs{
    		AllowDowntime: pulumi.Bool(false),
    		FromSnapshot:  pulumi.String("string"),
    	},
    })
    
    resource "defang-gcp_redis" "redisResource" {
      deploy = {
        replicas = 0
        resources = {
          reservations = {
            cpus   = 0
            memory = "string"
          }
        }
      }
      image = "string"
      ports {
        target       = 0
        app_protocol = "string"
        listener     = "string"
        mode         = "string"
        protocol     = "string"
      }
      redis = {
        allow_downtime = false
        from_snapshot  = "string"
      }
    }
    
    var redisResource = new Redis("redisResource", RedisArgs.builder()
        .deploy(DeployConfigArgs.builder()
            .replicas(0)
            .resources(ResourcesArgs.builder()
                .reservations(ResourceConfigArgs.builder()
                    .cpus(0.0)
                    .memory("string")
                    .build())
                .build())
            .build())
        .image("string")
        .ports(ServicePortConfigArgs.builder()
            .target(0)
            .appProtocol("string")
            .listener("string")
            .mode("string")
            .protocol("string")
            .build())
        .redis(RedisConfigArgs.builder()
            .allowDowntime(false)
            .fromSnapshot("string")
            .build())
        .build());
    
    redis_resource = defang_gcp.Redis("redisResource",
        deploy={
            "replicas": 0,
            "resources": {
                "reservations": {
                    "cpus": float(0),
                    "memory": "string",
                },
            },
        },
        image="string",
        ports=[{
            "target": 0,
            "app_protocol": "string",
            "listener": "string",
            "mode": "string",
            "protocol": "string",
        }],
        redis={
            "allow_downtime": False,
            "from_snapshot": "string",
        })
    
    const redisResource = new defang_gcp.Redis("redisResource", {
        deploy: {
            replicas: 0,
            resources: {
                reservations: {
                    cpus: 0,
                    memory: "string",
                },
            },
        },
        image: "string",
        ports: [{
            target: 0,
            appProtocol: "string",
            listener: "string",
            mode: "string",
            protocol: "string",
        }],
        redis: {
            allowDowntime: false,
            fromSnapshot: "string",
        },
    });
    
    type: defang-gcp:Redis
    properties:
        deploy:
            replicas: 0
            resources:
                reservations:
                    cpus: 0
                    memory: string
        image: string
        ports:
            - appProtocol: string
              listener: string
              mode: string
              protocol: string
              target: 0
        redis:
            allowDowntime: false
            fromSnapshot: string
    

    Redis Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Redis resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Redis resource produces the following output properties:

    Endpoint string
    Endpoint string
    endpoint string
    endpoint String
    endpoint string
    endpoint String

    Supporting Types

    DeployConfig, DeployConfigArgs

    RedisConfig, RedisConfigArgs

    ResourceConfig, ResourceConfigArgs

    Cpus double
    Memory string
    Cpus float64
    Memory string
    cpus number
    memory string
    cpus Double
    memory String
    cpus number
    memory string
    cpus float
    memory str
    cpus Number
    memory String

    Resources, ResourcesArgs

    ServicePortConfig, ServicePortConfigArgs

    Target int
    AppProtocol string
    Listener string
    Mode string
    Protocol string
    Target int
    AppProtocol string
    Listener string
    Mode string
    Protocol string
    target number
    app_protocol string
    listener string
    mode string
    protocol string
    target Integer
    appProtocol String
    listener String
    mode String
    protocol String
    target number
    appProtocol string
    listener string
    mode string
    protocol string
    target Number
    appProtocol String
    listener String
    mode String
    protocol String

    Package Details

    Repository
    defang-gcp DefangLabs/pulumi-defang
    License
    Apache-2.0
    defang-gcp logo
    Viewing docs for Defang GCP v2.4.1
    published on Saturday, Jul 11, 2026 by Defang

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial