Create IamResource Resource {#create}#

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

Constructor syntax#

new IamResource(name: string, args?: IamResourceArgs, opts?: ComponentResourceOptions);
@overload
def IamResource(resource_name: str,
                args: Optional[IamResourceArgs] = None,
                opts: Optional[ResourceOptions] = None)

@overload
def IamResource(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                config: Optional[pulumi_google_native.iam.v1.AuditConfigArgs] = None)
func NewIamResource(ctx *Context, name string, args *IamResourceArgs, opts ...ResourceOption) (*IamResource, error)
public IamResource(string name, IamResourceArgs? args = null, ComponentResourceOptions? opts = null)
public IamResource(String name, IamResourceArgs args)
public IamResource(String name, IamResourceArgs args, ComponentResourceOptions options)
type: example:myModule:IamResource
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

resource "example_my_module_iam_resource" "name" {
    # resource properties
}

Parameters#

name string
The unique name of the resource.
args IamResourceArgs
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 IamResourceArgs
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 IamResourceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IamResourceArgs
The arguments to resource properties.
opts ComponentResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args IamResourceArgs
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 iamResourceResource = new Example.MyModule.IamResource("iamResourceResource", new()
{
    Config = new GoogleNative.IAM.V1.Inputs.AuditConfigArgs
    {
        AuditLogConfigs = new[]
        {
            new GoogleNative.IAM.V1.Inputs.AuditLogConfigArgs
            {
                ExemptedMembers = new[]
                {
                    "string",
                },
                LogType = GoogleNative.IAM.V1.AuditLogConfigLogType.LogTypeUnspecified,
            },
        },
        Service = "string",
    },
});
example, err := mymodule.NewIamResource(ctx, "iamResourceResource", &mymodule.IamResourceArgs{
	Config: &iam.AuditConfigArgs{
		AuditLogConfigs: iam.AuditLogConfigArray{
			&iam.AuditLogConfigArgs{
				ExemptedMembers: pulumi.StringArray{
					pulumi.String("string"),
				},
				LogType: iam.AuditLogConfigLogTypeLogTypeUnspecified,
			},
		},
		Service: pulumi.String("string"),
	},
})
resource "example_my_module_iam_resource" "iamResourceResource" {
  lifecycle {
    create_before_destroy = true
  }
  config = {
    audit_log_configs = [{
      exempted_members = ["string"]
      log_type         = "LOG_TYPE_UNSPECIFIED"
    }]
    service = "string"
  }
}
var iamResourceResource = new IamResource("iamResourceResource", IamResourceArgs.builder()
    .config(AuditConfigArgs.builder()
        .auditLogConfigs(AuditLogConfigArgs.builder()
            .exemptedMembers("string")
            .logType("LOG_TYPE_UNSPECIFIED")
            .build())
        .service("string")
        .build())
    .build());
iam_resource_resource = example.mymodule.IamResource("iamResourceResource", config={
    "audit_log_configs": [{
        "exempted_members": ["string"],
        "log_type": google_native.iam.v1.AuditLogConfigLogType.LOG_TYPE_UNSPECIFIED,
    }],
    "service": "string",
})
const iamResourceResource = new example.mymodule.IamResource("iamResourceResource", {config: {
    auditLogConfigs: [{
        exemptedMembers: ["string"],
        logType: google_native.iam.v1.AuditLogConfigLogType.LogTypeUnspecified,
    }],
    service: "string",
}});
type: example:myModule:IamResource
properties:
    config:
        auditLogConfigs:
            - exemptedMembers:
                - string
              logType: LOG_TYPE_UNSPECIFIED
        service: string

IamResource Resource Properties {#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 IamResource resource accepts the following input properties:

Config AuditConfigArgs
This type is defined in the Google Cloud Native package.
config object
This type is defined in the Google Cloud Native package.
config AuditConfig
This type is defined in the Google Cloud Native package.
config Property Map
This type is defined in the Google Cloud Native package.

Outputs#

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

Package Details

Repository
example
License

Updated

Was this page helpful?