5.7 Resource Types

Each resource in a pipeline has a type. The resource's type determines what versions are detected, the bits that are fetched when used for a get step, and the side effect that occurs when used for a put step.

Out of the box, Concourse comes with a few resource types to cover common CI use cases like dealing with Git repositories and S3 buckets.

Beyond these core types, each pipeline can configure its own resource types by specifying resource_types at the top level. Each resource type is itself defined as a resource that provides the container image for the pipeline resource type (see Implementing a Resource). You will almost always be using the docker-image resource type when doing this.

Pipeline-provided resource types can override the core resource types, and can be defined in terms of each other. Also, a pipeline resource type can use the core type that it's overriding. This is useful if you want to e.g. provide your own custom docker-image resource, by overriding the core one (and using it one last time for the override itself), and then using it for all other pipeline resource types.

Similar to Resources, each configured resource type consists of the following attributes:

name: string

Required. The name of the new resource type. This should be short and simple. This name will be referenced by resources defined within the same pipeline, and image_resources used by tasks running in the pipeline.

type: string

Required. The type of the resource used to provide the resource type's container image. Yes, this is a bit meta. Usually this will be docker-image, as the resource type must result in a container image, though there may be other image formats (possibly themselves defined as pipeline resource types!).

source: object

Optional. The location of the resource type's resource. This varies by resource type, and is a black box to Concourse; it is blindly passed to the resource at runtime.

To use docker-image as an example, the source would contain something like repository: username/reponame. See the Docker Image resource (or whatever resource type your resource type uses) for more information.

privileged: boolean

Optional. Default false. If set to true, the resource's containers will be run with full capabilities, as determined by the Garden backend the task runs on. For Linux-based backends it typically determines whether or not the container will run in a separate user namespace, and whether the root user is "actual" root (if set to true) or a user namespaced root (if set to false, the default).

This is a gaping security hole; only configure it if the resource type needs it (which should be called out in its documentation). This is not up to the resource type to decide dynamically, so as to prevent privilege escalation via third-party resource type exploits.

params: object

Optional. Arbitrary params to pass when fetching the resource.

check_every: string

Optional. Default 1m. The interval on which to check for new versions of the resource type. Acceptable interval options are defined by the time.ParseDuration function.

tags: [string]

Optional. Default []. A list of tags to determine which workers the checks will be performed on. You'll want to specify this if the source is internal to a worker's network, for example. See also tags step modifier.

  1. Managing Resource Types
    1. fly check-resource-type
  2. Resources Provided With Concourse
    1. Deprecated Resources
  3. Community Resources
    1. Adding to this list
  4. Implementing a Resource
    1. check: Check for new versions.
    2. in: Fetch a given resource.
    3. out: Update a resource.
    4. Metadata
    5. Certificate Propagation


Using Resource Types

Resource Types can be used to extend the functionality of your pipeline and provide deeper integrations. This example uses one to trigger a job whenever a new Dinosaur Comic is out.

- name: rss
  type: docker-image
    repository: suhlig/concourse-rss-resource
    tag: latest

- name: booklit-releases
  type: rss

- name: announce
  - get: booklit-releases
    trigger: true