1. Packages
  2. Hsdp Provider
  3. API Docs
  4. S3credsPolicy
hsdp 0.65.3 published on Tuesday, Apr 15, 2025 by philips-software

hsdp.S3credsPolicy

Explore with Pulumi AI

Provides a resource for managing HSDP S3 Credentials policies

This resource is only available when credentials_url is set in the provider config

Example Usage

The following example creates a new policy

import * as pulumi from "@pulumi/pulumi";
import * as hsdp from "@pulumi/hsdp";

const policy1 = new hsdp.S3credsPolicy("policy1", {
    productKey: _var.credentials_product_key,
    policy: `{
  "conditions": {
    "managingOrganizations": [ "${_var.org_id}" ],
    "groups": [ "PublishGroup" ]
  },
  "allowed": {
    "resources": [ "${_var.org_id}/foo/*" ],
    "actions": [
      "GET",
      "PUT",
      "LIST",
      "DELETE"
    ]
  }
}
`,
});
Copy
import pulumi
import pulumi_hsdp as hsdp

policy1 = hsdp.S3credsPolicy("policy1",
    product_key=var["credentials_product_key"],
    policy=f"""{{
  "conditions": {{
    "managingOrganizations": [ "{var["org_id"]}" ],
    "groups": [ "PublishGroup" ]
  }},
  "allowed": {{
    "resources": [ "{var["org_id"]}/foo/*" ],
    "actions": [
      "GET",
      "PUT",
      "LIST",
      "DELETE"
    ]
  }}
}}
""")
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hsdp.NewS3credsPolicy(ctx, "policy1", &hsdp.S3credsPolicyArgs{
			ProductKey: pulumi.Any(_var.Credentials_product_key),
			Policy: pulumi.Sprintf(`{
  "conditions": {
    "managingOrganizations": [ "%v" ],
    "groups": [ "PublishGroup" ]
  },
  "allowed": {
    "resources": [ "%v/foo/*" ],
    "actions": [
      "GET",
      "PUT",
      "LIST",
      "DELETE"
    ]
  }
}
`, _var.Org_id, _var.Org_id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hsdp = Pulumi.Hsdp;

return await Deployment.RunAsync(() => 
{
    var policy1 = new Hsdp.S3credsPolicy("policy1", new()
    {
        ProductKey = @var.Credentials_product_key,
        Policy = @$"{{
  ""conditions"": {{
    ""managingOrganizations"": [ ""{@var.Org_id}"" ],
    ""groups"": [ ""PublishGroup"" ]
  }},
  ""allowed"": {{
    ""resources"": [ ""{@var.Org_id}/foo/*"" ],
    ""actions"": [
      ""GET"",
      ""PUT"",
      ""LIST"",
      ""DELETE""
    ]
  }}
}}
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hsdp.S3credsPolicy;
import com.pulumi.hsdp.S3credsPolicyArgs;
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 policy1 = new S3credsPolicy("policy1", S3credsPolicyArgs.builder()
            .productKey(var_.credentials_product_key())
            .policy("""
{
  "conditions": {
    "managingOrganizations": [ "%s" ],
    "groups": [ "PublishGroup" ]
  },
  "allowed": {
    "resources": [ "%s/foo/*" ],
    "actions": [
      "GET",
      "PUT",
      "LIST",
      "DELETE"
    ]
  }
}
", var_.org_id(),var_.org_id()))
            .build());

    }
}
Copy
resources:
  policy1:
    type: hsdp:S3credsPolicy
    properties:
      productKey: ${var.credentials_product_key}
      policy: |
        {
          "conditions": {
            "managingOrganizations": [ "${var.org_id}" ],
            "groups": [ "PublishGroup" ]
          },
          "allowed": {
            "resources": [ "${var.org_id}/foo/*" ],
            "actions": [
              "GET",
              "PUT",
              "LIST",
              "DELETE"
            ]
          }
        }        
Copy

Create S3credsPolicy Resource

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

Constructor syntax

new S3credsPolicy(name: string, args: S3credsPolicyArgs, opts?: CustomResourceOptions);
@overload
def S3credsPolicy(resource_name: str,
                  args: S3credsPolicyArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def S3credsPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  policy: Optional[str] = None,
                  product_key: Optional[str] = None,
                  s3creds_policy_id: Optional[str] = None)
func NewS3credsPolicy(ctx *Context, name string, args S3credsPolicyArgs, opts ...ResourceOption) (*S3credsPolicy, error)
public S3credsPolicy(string name, S3credsPolicyArgs args, CustomResourceOptions? opts = null)
public S3credsPolicy(String name, S3credsPolicyArgs args)
public S3credsPolicy(String name, S3credsPolicyArgs args, CustomResourceOptions options)
type: hsdp:S3credsPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. S3credsPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. S3credsPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. S3credsPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. S3credsPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. S3credsPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

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

var s3credsPolicyResource = new Hsdp.S3credsPolicy("s3credsPolicyResource", new()
{
    Policy = "string",
    ProductKey = "string",
    S3credsPolicyId = "string",
});
Copy
example, err := hsdp.NewS3credsPolicy(ctx, "s3credsPolicyResource", &hsdp.S3credsPolicyArgs{
	Policy:          pulumi.String("string"),
	ProductKey:      pulumi.String("string"),
	S3credsPolicyId: pulumi.String("string"),
})
Copy
var s3credsPolicyResource = new S3credsPolicy("s3credsPolicyResource", S3credsPolicyArgs.builder()
    .policy("string")
    .productKey("string")
    .s3credsPolicyId("string")
    .build());
Copy
s3creds_policy_resource = hsdp.S3credsPolicy("s3credsPolicyResource",
    policy="string",
    product_key="string",
    s3creds_policy_id="string")
Copy
const s3credsPolicyResource = new hsdp.S3credsPolicy("s3credsPolicyResource", {
    policy: "string",
    productKey: "string",
    s3credsPolicyId: "string",
});
Copy
type: hsdp:S3credsPolicy
properties:
    policy: string
    productKey: string
    s3credsPolicyId: string
Copy

S3credsPolicy 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 S3credsPolicy resource accepts the following input properties:

Policy This property is required. string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
ProductKey This property is required. string
The product key (tenant) for which this policy should apply to
S3credsPolicyId string
The ID of the policy
Policy This property is required. string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
ProductKey This property is required. string
The product key (tenant) for which this policy should apply to
S3credsPolicyId string
The ID of the policy
policy This property is required. String
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey This property is required. String
The product key (tenant) for which this policy should apply to
s3credsPolicyId String
The ID of the policy
policy This property is required. string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey This property is required. string
The product key (tenant) for which this policy should apply to
s3credsPolicyId string
The ID of the policy
policy This property is required. str
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
product_key This property is required. str
The product key (tenant) for which this policy should apply to
s3creds_policy_id str
The ID of the policy
policy This property is required. String
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey This property is required. String
The product key (tenant) for which this policy should apply to
s3credsPolicyId String
The ID of the policy

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing S3credsPolicy Resource

Get an existing S3credsPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: S3credsPolicyState, opts?: CustomResourceOptions): S3credsPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        policy: Optional[str] = None,
        product_key: Optional[str] = None,
        s3creds_policy_id: Optional[str] = None) -> S3credsPolicy
func GetS3credsPolicy(ctx *Context, name string, id IDInput, state *S3credsPolicyState, opts ...ResourceOption) (*S3credsPolicy, error)
public static S3credsPolicy Get(string name, Input<string> id, S3credsPolicyState? state, CustomResourceOptions? opts = null)
public static S3credsPolicy get(String name, Output<String> id, S3credsPolicyState state, CustomResourceOptions options)
resources:  _:    type: hsdp:S3credsPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Policy string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
ProductKey string
The product key (tenant) for which this policy should apply to
S3credsPolicyId string
The ID of the policy
Policy string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
ProductKey string
The product key (tenant) for which this policy should apply to
S3credsPolicyId string
The ID of the policy
policy String
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey String
The product key (tenant) for which this policy should apply to
s3credsPolicyId String
The ID of the policy
policy string
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey string
The product key (tenant) for which this policy should apply to
s3credsPolicyId string
The ID of the policy
policy str
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
product_key str
The product key (tenant) for which this policy should apply to
s3creds_policy_id str
The ID of the policy
policy String
The policy definition. This is a JSON string as per HSDP S3 Credentials documentation
productKey String
The product key (tenant) for which this policy should apply to
s3credsPolicyId String
The ID of the policy

Import

Importing existing policies is currently not supported

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
hsdp philips-software/terraform-provider-hsdp
License
Notes
This Pulumi package is based on the hsdp Terraform Provider.