Skip to content

create_instance_profile

create_instance_profile(
    *,
    config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
    availability_zone: Optional[String] = None,
    kms_key_arn: Optional[String] = None,
    publicly_accessible: Optional[BooleanOptional] = None,
    tags: Optional[TagList] = None,
    network_type: Optional[String] = None,
    instance_profile_name: Optional[String] = None,
    description: Optional[String] = None,
    subnet_group_identifier: Optional[String] = None,
    vpc_security_groups: Optional[StringList] = None,
) -> CreateInstanceProfileResponse

Creates the instance profile using the specified parameters.

Required permissions: dms:CreateInstanceProfile. For more information, see Actions, resources, and condition keys for Database Migration Service.

Parameters:

  • availability_zone (Optional[String], default: None ) –

    The Availability Zone where the instance profile will be created. The default value is a random, system-chosen Availability Zone in the Amazon Web Services Region where your data provider is created, for examplem us-east-1d.

  • kms_key_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.

    If you don't specify a value for the KmsKeyArn parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.

  • publicly_accessible (Optional[BooleanOptional], default: None ) –

    Specifies the accessibility options for the instance profile. A value of true represents an instance profile with a public IP address. A value of false represents an instance profile with a private IP address. The default value is true.

  • tags (Optional[TagList], default: None ) –

    One or more tags to be assigned to the instance profile.

  • network_type (Optional[String], default: None ) –

    Specifies the network type for the instance profile. A value of IPV4 represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of IPV6 represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of DUAL represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.

  • instance_profile_name (Optional[String], default: None ) –

    A user-friendly name for the instance profile.

  • description (Optional[String], default: None ) –

    A user-friendly description of the instance profile.

  • subnet_group_identifier (Optional[String], default: None ) –

    A subnet group to associate with the instance profile.

  • vpc_security_groups (Optional[StringList], default: None ) –

    Specifies the VPC security group names to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.

Raises:

Examples:

Create an instance profile The following example creates an instance profile.

>>> client.create_instance_profile(instance_profile_name='example-instance-profile', description='Example instance profile for documentation', subnet_group_identifier='example-replication-subnet-group', vpc_security_groups=['sg-0123456789abcdef0'], kms_key_arn='arn:aws:kms:us-east-1:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', network_type='IPV4', publicly_accessible=False)
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
def create_instance_profile(
    self,
    *,
    config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
    availability_zone: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    kms_key_arn: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    publicly_accessible: Optional[
        "capo_database_migration_service.types.boolean_optional.BooleanOptional"
    ] = None,
    tags: Optional["capo_database_migration_service.types.tag_list.TagList"] = None,
    network_type: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    instance_profile_name: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    description: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    subnet_group_identifier: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    vpc_security_groups: Optional[
        "capo_database_migration_service.types.string_list.StringList"
    ] = None,
) -> "capo_database_migration_service.types.create_instance_profile_response.CreateInstanceProfileResponse":
    """<p>Creates the instance profile using the specified parameters.</p> <p> <b>Required permissions:</b> <code>dms:CreateInstanceProfile</code>. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsdatabasemigrationservice.html">Actions, resources, and condition keys for Database Migration Service</a>.</p>

    Args:
        availability_zone: <p>The Availability Zone where the instance profile will be created. The default value is a random, system-chosen Availability Zone in the Amazon Web Services Region where your data provider is created, for examplem <code>us-east-1d</code>.</p>
        kms_key_arn: <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p> <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.</p>
        publicly_accessible: <p>Specifies the accessibility options for the instance profile. A value of <code>true</code> represents an instance profile with a public IP address. A value of <code>false</code> represents an instance profile with a private IP address. The default value is <code>true</code>.</p>
        tags: <p>One or more tags to be assigned to the instance profile.</p>
        network_type: <p>Specifies the network type for the instance profile. A value of <code>IPV4</code> represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of <code>IPV6</code> represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of <code>DUAL</code> represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.</p>
        instance_profile_name: <p>A user-friendly name for the instance profile.</p>
        description: <p>A user-friendly description of the instance profile.</p>
        subnet_group_identifier: <p>A subnet group to associate with the instance profile.</p>
        vpc_security_groups: <p>Specifies the VPC security group names to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>

    Raises:
        capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
        capo_database_migration_service.errors.failed_dependency_fault.FailedDependencyFault: <p>A dependency threw an exception.</p>
        capo_database_migration_service.errors.invalid_resource_state_fault.InvalidResourceStateFault: <p>The resource is in a state that prevents it from being used for database migration.</p>
        capo_database_migration_service.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>DMS cannot access the KMS key.</p>
        capo_database_migration_service.errors.resource_already_exists_fault.ResourceAlreadyExistsFault: <p>The resource you are attempting to create already exists.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.resource_quota_exceeded_fault.ResourceQuotaExceededFault: <p>The quota for this resource quota has been exceeded.</p>
        capo_database_migration_service.errors.s3_access_denied_fault.S3AccessDeniedFault: <p>Insufficient privileges are preventing access to an Amazon S3 object.</p>
        capo_database_migration_service.errors.s3_resource_not_found_fault.S3ResourceNotFoundFault: <p>A specified Amazon S3 bucket, bucket folder, or other object can't be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create an instance profile
        The following example creates an instance profile.

        >>> client.create_instance_profile(instance_profile_name='example-instance-profile', description='Example instance profile for documentation', subnet_group_identifier='example-replication-subnet-group', vpc_security_groups=['sg-0123456789abcdef0'], kms_key_arn='arn:aws:kms:us-east-1:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', network_type='IPV4', publicly_accessible=False)
    """

    def _handler(
        req: "OperationRequest[capo_database_migration_service.types.create_instance_profile_message.CreateInstanceProfileMessage]",
    ) -> OperationResponse[
        "capo_database_migration_service.types.create_instance_profile_response.CreateInstanceProfileResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.create_instance_profile

        output, http_response = (
            capo_database_migration_service._operations.amazon_dm_sv20160101.create_instance_profile.create_instance_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateInstanceProfile")
    )
    input_: capo_database_migration_service.types.create_instance_profile_message.CreateInstanceProfileMessage = {}
    if availability_zone is not None:
        input_["availability_zone"] = availability_zone
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if publicly_accessible is not None:
        input_["publicly_accessible"] = publicly_accessible
    if tags is not None:
        input_["tags"] = tags
    if network_type is not None:
        input_["network_type"] = network_type
    if instance_profile_name is not None:
        input_["instance_profile_name"] = instance_profile_name
    if description is not None:
        input_["description"] = description
    if subnet_group_identifier is not None:
        input_["subnet_group_identifier"] = subnet_group_identifier
    if vpc_security_groups is not None:
        input_["vpc_security_groups"] = vpc_security_groups

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output