volcengine.organization.ServiceControlPolicy
Explore with Pulumi AI
Provides a resource to manage organization service control policy
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var foo = new Volcengine.Organization.ServiceControlPolicy("foo", new()
{
Description = "tftest1",
PolicyName = "tfpolicy11",
Statement = "{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}",
});
var foo2 = new Volcengine.Organization.ServiceControlPolicy("foo2", new()
{
PolicyName = "tfpolicy21",
Statement = "{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:DeleteInstance\"],\"Resource\":[\"*\"]}]}",
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/organization"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organization.NewServiceControlPolicy(ctx, "foo", &organization.ServiceControlPolicyArgs{
Description: pulumi.String("tftest1"),
PolicyName: pulumi.String("tfpolicy11"),
Statement: pulumi.String("{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}"),
})
if err != nil {
return err
}
_, err = organization.NewServiceControlPolicy(ctx, "foo2", &organization.ServiceControlPolicyArgs{
PolicyName: pulumi.String("tfpolicy21"),
Statement: pulumi.String("{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:DeleteInstance\"],\"Resource\":[\"*\"]}]}"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.organization.ServiceControlPolicy;
import com.pulumi.volcengine.organization.ServiceControlPolicyArgs;
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 foo = new ServiceControlPolicy("foo", ServiceControlPolicyArgs.builder()
.description("tftest1")
.policyName("tfpolicy11")
.statement("{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}")
.build());
var foo2 = new ServiceControlPolicy("foo2", ServiceControlPolicyArgs.builder()
.policyName("tfpolicy21")
.statement("{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:DeleteInstance\"],\"Resource\":[\"*\"]}]}")
.build());
}
}
import pulumi
import pulumi_volcengine as volcengine
foo = volcengine.organization.ServiceControlPolicy("foo",
description="tftest1",
policy_name="tfpolicy11",
statement="{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}")
foo2 = volcengine.organization.ServiceControlPolicy("foo2",
policy_name="tfpolicy21",
statement="{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:DeleteInstance\"],\"Resource\":[\"*\"]}]}")
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const foo = new volcengine.organization.ServiceControlPolicy("foo", {
description: "tftest1",
policyName: "tfpolicy11",
statement: "{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:RunInstances\"],\"Resource\":[\"*\"]}]}",
});
const foo2 = new volcengine.organization.ServiceControlPolicy("foo2", {
policyName: "tfpolicy21",
statement: "{\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ecs:DeleteInstance\"],\"Resource\":[\"*\"]}]}",
});
resources:
foo:
type: volcengine:organization:ServiceControlPolicy
properties:
description: tftest1
policyName: tfpolicy11
statement: '{"Statement":[{"Effect":"Deny","Action":["ecs:RunInstances"],"Resource":["*"]}]}'
foo2:
type: volcengine:organization:ServiceControlPolicy
properties:
policyName: tfpolicy21
statement: '{"Statement":[{"Effect":"Deny","Action":["ecs:DeleteInstance"],"Resource":["*"]}]}'
Create ServiceControlPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceControlPolicy(name: string, args: ServiceControlPolicyArgs, opts?: CustomResourceOptions);
@overload
def ServiceControlPolicy(resource_name: str,
args: ServiceControlPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceControlPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_name: Optional[str] = None,
statement: Optional[str] = None,
description: Optional[str] = None)
func NewServiceControlPolicy(ctx *Context, name string, args ServiceControlPolicyArgs, opts ...ResourceOption) (*ServiceControlPolicy, error)
public ServiceControlPolicy(string name, ServiceControlPolicyArgs args, CustomResourceOptions? opts = null)
public ServiceControlPolicy(String name, ServiceControlPolicyArgs args)
public ServiceControlPolicy(String name, ServiceControlPolicyArgs args, CustomResourceOptions options)
type: volcengine:organization:ServiceControlPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ServiceControlPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServiceControlPolicyArgs
- 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 ServiceControlPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceControlPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceControlPolicyArgs
- 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 serviceControlPolicyResource = new Volcengine.Organization.ServiceControlPolicy("serviceControlPolicyResource", new()
{
PolicyName = "string",
Statement = "string",
Description = "string",
});
example, err := organization.NewServiceControlPolicy(ctx, "serviceControlPolicyResource", &organization.ServiceControlPolicyArgs{
PolicyName: pulumi.String("string"),
Statement: pulumi.String("string"),
Description: pulumi.String("string"),
})
var serviceControlPolicyResource = new ServiceControlPolicy("serviceControlPolicyResource", ServiceControlPolicyArgs.builder()
.policyName("string")
.statement("string")
.description("string")
.build());
service_control_policy_resource = volcengine.organization.ServiceControlPolicy("serviceControlPolicyResource",
policy_name="string",
statement="string",
description="string")
const serviceControlPolicyResource = new volcengine.organization.ServiceControlPolicy("serviceControlPolicyResource", {
policyName: "string",
statement: "string",
description: "string",
});
type: volcengine:organization:ServiceControlPolicy
properties:
description: string
policyName: string
statement: string
ServiceControlPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ServiceControlPolicy resource accepts the following input properties:
- Policy
Name string - The name of the Policy.
- Statement string
- The statement of the Policy.
- Description string
- The description of the Policy.
- Policy
Name string - The name of the Policy.
- Statement string
- The statement of the Policy.
- Description string
- The description of the Policy.
- policy
Name String - The name of the Policy.
- statement String
- The statement of the Policy.
- description String
- The description of the Policy.
- policy
Name string - The name of the Policy.
- statement string
- The statement of the Policy.
- description string
- The description of the Policy.
- policy_
name str - The name of the Policy.
- statement str
- The statement of the Policy.
- description str
- The description of the Policy.
- policy
Name String - The name of the Policy.
- statement String
- The statement of the Policy.
- description String
- The description of the Policy.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceControlPolicy resource produces the following output properties:
- Create
Date string - The create time of the Policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Type string - The type of the Policy.
- Update
Date string - The update time of the Policy.
- Create
Date string - The create time of the Policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Type string - The type of the Policy.
- Update
Date string - The update time of the Policy.
- create
Date String - The create time of the Policy.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Type String - The type of the Policy.
- update
Date String - The update time of the Policy.
- create
Date string - The create time of the Policy.
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Type string - The type of the Policy.
- update
Date string - The update time of the Policy.
- create_
date str - The create time of the Policy.
- id str
- The provider-assigned unique ID for this managed resource.
- policy_
type str - The type of the Policy.
- update_
date str - The update time of the Policy.
- create
Date String - The create time of the Policy.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Type String - The type of the Policy.
- update
Date String - The update time of the Policy.
Look up Existing ServiceControlPolicy Resource
Get an existing ServiceControlPolicy 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?: ServiceControlPolicyState, opts?: CustomResourceOptions): ServiceControlPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_date: Optional[str] = None,
description: Optional[str] = None,
policy_name: Optional[str] = None,
policy_type: Optional[str] = None,
statement: Optional[str] = None,
update_date: Optional[str] = None) -> ServiceControlPolicy
func GetServiceControlPolicy(ctx *Context, name string, id IDInput, state *ServiceControlPolicyState, opts ...ResourceOption) (*ServiceControlPolicy, error)
public static ServiceControlPolicy Get(string name, Input<string> id, ServiceControlPolicyState? state, CustomResourceOptions? opts = null)
public static ServiceControlPolicy get(String name, Output<String> id, ServiceControlPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Create
Date string - The create time of the Policy.
- Description string
- The description of the Policy.
- Policy
Name string - The name of the Policy.
- Policy
Type string - The type of the Policy.
- Statement string
- The statement of the Policy.
- Update
Date string - The update time of the Policy.
- Create
Date string - The create time of the Policy.
- Description string
- The description of the Policy.
- Policy
Name string - The name of the Policy.
- Policy
Type string - The type of the Policy.
- Statement string
- The statement of the Policy.
- Update
Date string - The update time of the Policy.
- create
Date String - The create time of the Policy.
- description String
- The description of the Policy.
- policy
Name String - The name of the Policy.
- policy
Type String - The type of the Policy.
- statement String
- The statement of the Policy.
- update
Date String - The update time of the Policy.
- create
Date string - The create time of the Policy.
- description string
- The description of the Policy.
- policy
Name string - The name of the Policy.
- policy
Type string - The type of the Policy.
- statement string
- The statement of the Policy.
- update
Date string - The update time of the Policy.
- create_
date str - The create time of the Policy.
- description str
- The description of the Policy.
- policy_
name str - The name of the Policy.
- policy_
type str - The type of the Policy.
- statement str
- The statement of the Policy.
- update_
date str - The update time of the Policy.
- create
Date String - The create time of the Policy.
- description String
- The description of the Policy.
- policy
Name String - The name of the Policy.
- policy
Type String - The type of the Policy.
- statement String
- The statement of the Policy.
- update
Date String - The update time of the Policy.
Import
Service Control Policy can be imported using the id, e.g.
$ pulumi import volcengine:organization/serviceControlPolicy:ServiceControlPolicy default 1000001
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.