Code Monkey home page Code Monkey logo

google_storage_bucket's Introduction

google_storage_bucket

Synopsis

  • Manages the state of Google Cloud Storage Buckets

Parameters

name:
  description:
    - The name of the bucket, must be unique within all of GCP.
    - When you create a bucket, you permanently define its name, its geographic location, and the project it is part of.
  required: true
project:
  description:
    - The name of the project to manage the Google storage bucket.
    - When you create a bucket, you permanently define its name, its geographic location, and the project it is part of.
state:
  description:
    - The state of the object in GCP
  choices:
    - present
    - absent
  default: present
  type: str
  required: false
storage_class:
  description:
    - Sets the default storage class of the bucket. For more information see: https://cloud.google.com/storage/docs/storage-classes
  choices:
    - STANDARD
    - NEARLINE
    - COLDLINE
    - ARCHIVE
  default: STANDARD
  type: str
  required: false
location:
  description:
    - The location of the bucket. If not passed, the default location, US, will be used. See https://cloud.google.com/storage/docs/bucket-locations
    - When you create a bucket, you permanently define its name, its geographic location, and the project it is part of.
  default: us
  type: str
  required: false
force:
  description:
    - When true, destroy a bucket even if there are objects in it.
    - When false, destroying a bucket will cause the module to fail.
  choices:
    - true
    - false
  default: false
  type: bool
  required: false

Requirements

The below requirements are needed on the host that executes this module.

  • "google-cloud-storage >= 1.31.0"

Examples

  • Ensure my-project-bucket exists in my-project
- name: Create my-project-bucket
  google_storage_bucket:
    name: "my-project-bucket"
    project: "my-project"
    storage_class: "NEARLINE"
    location: "us-central1"
    state: present
  • Ensure my-project-bucket does not exist
- name: Delete my-project-bucket
  google_storage_bucket:
    name: "my-project-bucket"
    state: absent

Return Values

changed:
  description: True if action was taken to create or destroy a bucket.
  type: bool
  returned: always
name:
  description: The name of the bucket.
  type: str
  returned: always
state:
  description: The state of the bucket, present or absent.
  type: str
  returned: always
storage_class:
  description: The default storage class of the bucket.
  type: str
  returned: always
location:
  description: The geographic location of the bucket.
  type: str
  returned: always

Authors

  • Michael Shen (@mjlshen)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.