Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.iam/v1.Role
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
Creates a new custom Role.
Create Role Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Role(name: string, args?: RoleArgs, opts?: CustomResourceOptions);@overload
def Role(resource_name: str,
         args: Optional[RoleArgs] = None,
         opts: Optional[ResourceOptions] = None)
@overload
def Role(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         deleted: Optional[bool] = None,
         description: Optional[str] = None,
         etag: Optional[str] = None,
         included_permissions: Optional[Sequence[str]] = None,
         name: Optional[str] = None,
         project: Optional[str] = None,
         role_id: Optional[str] = None,
         stage: Optional[RoleStage] = None,
         title: Optional[str] = None)func NewRole(ctx *Context, name string, args *RoleArgs, opts ...ResourceOption) (*Role, error)public Role(string name, RoleArgs? args = null, CustomResourceOptions? opts = null)type: google-native:iam/v1:Role
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 RoleArgs
- 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 RoleArgs
- 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 RoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleArgs
- 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 roleResource = new GoogleNative.IAM.V1.Role("roleResource", new()
{
    Deleted = false,
    Description = "string",
    Etag = "string",
    IncludedPermissions = new[]
    {
        "string",
    },
    Name = "string",
    Project = "string",
    RoleId = "string",
    Stage = GoogleNative.IAM.V1.RoleStage.Alpha,
    Title = "string",
});
example, err := iam.NewRole(ctx, "roleResource", &iam.RoleArgs{
	Deleted:     pulumi.Bool(false),
	Description: pulumi.String("string"),
	Etag:        pulumi.String("string"),
	IncludedPermissions: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	RoleId:  pulumi.String("string"),
	Stage:   iam.RoleStageAlpha,
	Title:   pulumi.String("string"),
})
var roleResource = new Role("roleResource", RoleArgs.builder()
    .deleted(false)
    .description("string")
    .etag("string")
    .includedPermissions("string")
    .name("string")
    .project("string")
    .roleId("string")
    .stage("ALPHA")
    .title("string")
    .build());
role_resource = google_native.iam.v1.Role("roleResource",
    deleted=False,
    description="string",
    etag="string",
    included_permissions=["string"],
    name="string",
    project="string",
    role_id="string",
    stage=google_native.iam.v1.RoleStage.ALPHA,
    title="string")
const roleResource = new google_native.iam.v1.Role("roleResource", {
    deleted: false,
    description: "string",
    etag: "string",
    includedPermissions: ["string"],
    name: "string",
    project: "string",
    roleId: "string",
    stage: google_native.iam.v1.RoleStage.Alpha,
    title: "string",
});
type: google-native:iam/v1:Role
properties:
    deleted: false
    description: string
    etag: string
    includedPermissions:
        - string
    name: string
    project: string
    roleId: string
    stage: ALPHA
    title: string
Role 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 Role resource accepts the following input properties:
- Deleted bool
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- Description string
- Optional. A human-readable description for the role.
- Etag string
- Used to perform a consistent read-modify-write.
- IncludedPermissions List<string>
- The names of the permissions this role grants when bound in an IAM policy.
- Name string
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- Project string
- RoleId string
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- Stage
Pulumi.Google Native. IAM. V1. Role Stage 
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- Title string
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
- Deleted bool
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- Description string
- Optional. A human-readable description for the role.
- Etag string
- Used to perform a consistent read-modify-write.
- IncludedPermissions []string
- The names of the permissions this role grants when bound in an IAM policy.
- Name string
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- Project string
- RoleId string
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- Stage
RoleStage 
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- Title string
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
- deleted Boolean
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- description String
- Optional. A human-readable description for the role.
- etag String
- Used to perform a consistent read-modify-write.
- includedPermissions List<String>
- The names of the permissions this role grants when bound in an IAM policy.
- name String
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- project String
- roleId String
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- stage
RoleStage 
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- title String
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
- deleted boolean
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- description string
- Optional. A human-readable description for the role.
- etag string
- Used to perform a consistent read-modify-write.
- includedPermissions string[]
- The names of the permissions this role grants when bound in an IAM policy.
- name string
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- project string
- roleId string
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- stage
RoleStage 
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- title string
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
- deleted bool
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- description str
- Optional. A human-readable description for the role.
- etag str
- Used to perform a consistent read-modify-write.
- included_permissions Sequence[str]
- The names of the permissions this role grants when bound in an IAM policy.
- name str
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- project str
- role_id str
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- stage
RoleStage 
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- title str
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
- deleted Boolean
- The current deleted state of the role. This field is read only. It will be ignored in calls to CreateRole and UpdateRole.
- description String
- Optional. A human-readable description for the role.
- etag String
- Used to perform a consistent read-modify-write.
- includedPermissions List<String>
- The names of the permissions this role grants when bound in an IAM policy.
- name String
- The name of the role. When Roleis used inCreateRole, the role name must not be set. WhenRoleis used in output and other input such asUpdateRole, the role name is the complete path. For example,roles/logging.viewerfor predefined roles,organizations/{ORGANIZATION_ID}/roles/my-rolefor organization-level custom roles, andprojects/{PROJECT_ID}/roles/my-rolefor project-level custom roles.
- project String
- roleId String
- The role ID to use for this role. A role ID may contain alphanumeric characters, underscores (_), and periods (.). It must contain a minimum of 3 characters and a maximum of 64 characters.
- stage "ALPHA" | "BETA" | "GA" | "DEPRECATED" | "DISABLED" | "EAP"
- The current launch stage of the role. If the ALPHAlaunch stage has been selected for a role, thestagefield will not be included in the returned definition for the role.
- title String
- Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes.
Outputs
All input properties are implicitly available as output properties. Additionally, the Role 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.
Supporting Types
RoleStage, RoleStageArgs    
- Alpha
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- Beta
- BETAThe user has indicated this role is currently in a Beta phase.
- Ga
- GAThe user has indicated this role is generally available.
- Deprecated
- DEPRECATEDThe user has indicated this role is being deprecated.
- Disabled
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- Eap
- EAPThe user has indicated this role is currently in an EAP phase.
- RoleStage Alpha 
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- RoleStage Beta 
- BETAThe user has indicated this role is currently in a Beta phase.
- RoleStage Ga 
- GAThe user has indicated this role is generally available.
- RoleStage Deprecated 
- DEPRECATEDThe user has indicated this role is being deprecated.
- RoleStage Disabled 
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- RoleStage Eap 
- EAPThe user has indicated this role is currently in an EAP phase.
- Alpha
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- Beta
- BETAThe user has indicated this role is currently in a Beta phase.
- Ga
- GAThe user has indicated this role is generally available.
- Deprecated
- DEPRECATEDThe user has indicated this role is being deprecated.
- Disabled
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- Eap
- EAPThe user has indicated this role is currently in an EAP phase.
- Alpha
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- Beta
- BETAThe user has indicated this role is currently in a Beta phase.
- Ga
- GAThe user has indicated this role is generally available.
- Deprecated
- DEPRECATEDThe user has indicated this role is being deprecated.
- Disabled
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- Eap
- EAPThe user has indicated this role is currently in an EAP phase.
- ALPHA
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- BETA
- BETAThe user has indicated this role is currently in a Beta phase.
- GA
- GAThe user has indicated this role is generally available.
- DEPRECATED
- DEPRECATEDThe user has indicated this role is being deprecated.
- DISABLED
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- EAP
- EAPThe user has indicated this role is currently in an EAP phase.
- "ALPHA"
- ALPHAThe user has indicated this role is currently in an Alpha phase. If this launch stage is selected, the stagefield will not be included when requesting the definition for a given role.
- "BETA"
- BETAThe user has indicated this role is currently in a Beta phase.
- "GA"
- GAThe user has indicated this role is generally available.
- "DEPRECATED"
- DEPRECATEDThe user has indicated this role is being deprecated.
- "DISABLED"
- DISABLEDThis role is disabled and will not contribute permissions to any principals it is granted to in policies.
- "EAP"
- EAPThe user has indicated this role is currently in an EAP phase.
Package Details
- Repository
- Google Cloud Native pulumi/pulumi-google-native
- License
- Apache-2.0
Google Cloud Native is in preview. Google Cloud Classic is fully supported.