pulumi_wasm_providers_gcp_mini::storage

Module transfer_job

source
Expand description

Creates a new Transfer Job in Google Cloud Storage Transfer.

To get more information about Google Cloud Storage Transfer, see:

§Example Usage

Example creating a nightly Transfer Job from an AWS S3 Bucket to a GCS bucket.

resources:
  s3-backup-bucket:
    type: gcp:storage:Bucket
    properties:
      name: ${awsS3Bucket}-backup
      storageClass: NEARLINE
      project: ${project}
      location: US
  s3-backup-bucketBucketIAMMember:
    type: gcp:storage:BucketIAMMember
    name: s3-backup-bucket
    properties:
      bucket: ${["s3-backup-bucket"].name}
      role: roles/storage.admin
      member: serviceAccount:${default.email}
    options:
      dependsOn:
        - ${["s3-backup-bucket"]}
  topic:
    type: gcp:pubsub:Topic
    properties:
      name: ${pubsubTopicName}
  notificationConfig:
    type: gcp:pubsub:TopicIAMMember
    name: notification_config
    properties:
      topic: ${topic.id}
      role: roles/pubsub.publisher
      member: serviceAccount:${default.email}
  s3-bucket-nightly-backup:
    type: gcp:storage:TransferJob
    properties:
      description: Nightly backup of S3 bucket
      project: ${project}
      transferSpec:
        objectConditions:
          maxTimeElapsedSinceLastModification: 600s
          excludePrefixes:
            - requests.gz
        transferOptions:
          deleteObjectsUniqueInSink: false
        awsS3DataSource:
          bucketName: ${awsS3Bucket}
          awsAccessKey:
            accessKeyId: ${awsAccessKey}
            secretAccessKey: ${awsSecretKey}
        gcsDataSink:
          bucketName: ${["s3-backup-bucket"].name}
          path: foo/bar/
      schedule:
        scheduleStartDate:
          year: 2018
          month: 10
          day: 1
        scheduleEndDate:
          year: 2019
          month: 1
          day: 15
        startTimeOfDay:
          hours: 23
          minutes: 30
          seconds: 0
          nanos: 0
        repeatInterval: 604800s
      notificationConfig:
        pubsubTopic: ${topic.id}
        eventTypes:
          - TRANSFER_OPERATION_SUCCESS
          - TRANSFER_OPERATION_FAILED
        payloadFormat: JSON
    options:
      dependsOn:
        - ${["s3-backup-bucketBucketIAMMember"]}
        - ${notificationConfig}
variables:
  default:
    fn::invoke:
      function: gcp:storage:getTransferProjectServiceAccount
      arguments:
        project: ${project}

§Import

Storage Transfer Jobs can be imported using the Transfer Job’s project and name (without the transferJob/ prefix), e.g.

  • {{project_id}}/{{name}}, where name is a numeric value.

When using the pulumi import command, Storage Transfer Jobs can be imported using one of the formats above. For example:

$ pulumi import gcp:storage/transferJob:TransferJob default {{project_id}}/123456789

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments