azuredevops.FeedRetentionPolicy
Explore with Pulumi AI
Manages the Feed Retention Policy within Azure DevOps.
Example Usage
Project Feed
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = new azuredevops.Project("example", {
    name: "Example Project",
    visibility: "private",
    versionControl: "Git",
    workItemTemplate: "Agile",
    description: "Managed by Pulumi",
});
const exampleFeed = new azuredevops.Feed("example", {
    name: "ExampleFeed",
    projectId: example.id,
});
const exampleFeedRetentionPolicy = new azuredevops.FeedRetentionPolicy("example", {
    projectId: example.id,
    feedId: exampleFeed.id,
    countLimit: 20,
    daysToKeepRecentlyDownloadedPackages: 30,
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example",
    name="Example Project",
    visibility="private",
    version_control="Git",
    work_item_template="Agile",
    description="Managed by Pulumi")
example_feed = azuredevops.Feed("example",
    name="ExampleFeed",
    project_id=example.id)
example_feed_retention_policy = azuredevops.FeedRetentionPolicy("example",
    project_id=example.id,
    feed_id=example_feed.id,
    count_limit=20,
    days_to_keep_recently_downloaded_packages=30)
package main
import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
			Name:             pulumi.String("Example Project"),
			Visibility:       pulumi.String("private"),
			VersionControl:   pulumi.String("Git"),
			WorkItemTemplate: pulumi.String("Agile"),
			Description:      pulumi.String("Managed by Pulumi"),
		})
		if err != nil {
			return err
		}
		exampleFeed, err := azuredevops.NewFeed(ctx, "example", &azuredevops.FeedArgs{
			Name:      pulumi.String("ExampleFeed"),
			ProjectId: example.ID(),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewFeedRetentionPolicy(ctx, "example", &azuredevops.FeedRetentionPolicyArgs{
			ProjectId:                            example.ID(),
			FeedId:                               exampleFeed.ID(),
			CountLimit:                           pulumi.Int(20),
			DaysToKeepRecentlyDownloadedPackages: pulumi.Int(30),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() => 
{
    var example = new AzureDevOps.Project("example", new()
    {
        Name = "Example Project",
        Visibility = "private",
        VersionControl = "Git",
        WorkItemTemplate = "Agile",
        Description = "Managed by Pulumi",
    });
    var exampleFeed = new AzureDevOps.Feed("example", new()
    {
        Name = "ExampleFeed",
        ProjectId = example.Id,
    });
    var exampleFeedRetentionPolicy = new AzureDevOps.FeedRetentionPolicy("example", new()
    {
        ProjectId = example.Id,
        FeedId = exampleFeed.Id,
        CountLimit = 20,
        DaysToKeepRecentlyDownloadedPackages = 30,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Project;
import com.pulumi.azuredevops.ProjectArgs;
import com.pulumi.azuredevops.Feed;
import com.pulumi.azuredevops.FeedArgs;
import com.pulumi.azuredevops.FeedRetentionPolicy;
import com.pulumi.azuredevops.FeedRetentionPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Project("example", ProjectArgs.builder()
            .name("Example Project")
            .visibility("private")
            .versionControl("Git")
            .workItemTemplate("Agile")
            .description("Managed by Pulumi")
            .build());
        var exampleFeed = new Feed("exampleFeed", FeedArgs.builder()
            .name("ExampleFeed")
            .projectId(example.id())
            .build());
        var exampleFeedRetentionPolicy = new FeedRetentionPolicy("exampleFeedRetentionPolicy", FeedRetentionPolicyArgs.builder()
            .projectId(example.id())
            .feedId(exampleFeed.id())
            .countLimit(20)
            .daysToKeepRecentlyDownloadedPackages(30)
            .build());
    }
}
resources:
  example:
    type: azuredevops:Project
    properties:
      name: Example Project
      visibility: private
      versionControl: Git
      workItemTemplate: Agile
      description: Managed by Pulumi
  exampleFeed:
    type: azuredevops:Feed
    name: example
    properties:
      name: ExampleFeed
      projectId: ${example.id}
  exampleFeedRetentionPolicy:
    type: azuredevops:FeedRetentionPolicy
    name: example
    properties:
      projectId: ${example.id}
      feedId: ${exampleFeed.id}
      countLimit: 20
      daysToKeepRecentlyDownloadedPackages: 30
Organization Feed
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = new azuredevops.Feed("example", {name: "examplefeed"});
const exampleFeedRetentionPolicy = new azuredevops.FeedRetentionPolicy("example", {
    feedId: example.id,
    countLimit: 20,
    daysToKeepRecentlyDownloadedPackages: 30,
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Feed("example", name="examplefeed")
example_feed_retention_policy = azuredevops.FeedRetentionPolicy("example",
    feed_id=example.id,
    count_limit=20,
    days_to_keep_recently_downloaded_packages=30)
package main
import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuredevops.NewFeed(ctx, "example", &azuredevops.FeedArgs{
			Name: pulumi.String("examplefeed"),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewFeedRetentionPolicy(ctx, "example", &azuredevops.FeedRetentionPolicyArgs{
			FeedId:                               example.ID(),
			CountLimit:                           pulumi.Int(20),
			DaysToKeepRecentlyDownloadedPackages: pulumi.Int(30),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() => 
{
    var example = new AzureDevOps.Feed("example", new()
    {
        Name = "examplefeed",
    });
    var exampleFeedRetentionPolicy = new AzureDevOps.FeedRetentionPolicy("example", new()
    {
        FeedId = example.Id,
        CountLimit = 20,
        DaysToKeepRecentlyDownloadedPackages = 30,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Feed;
import com.pulumi.azuredevops.FeedArgs;
import com.pulumi.azuredevops.FeedRetentionPolicy;
import com.pulumi.azuredevops.FeedRetentionPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Feed("example", FeedArgs.builder()
            .name("examplefeed")
            .build());
        var exampleFeedRetentionPolicy = new FeedRetentionPolicy("exampleFeedRetentionPolicy", FeedRetentionPolicyArgs.builder()
            .feedId(example.id())
            .countLimit(20)
            .daysToKeepRecentlyDownloadedPackages(30)
            .build());
    }
}
resources:
  example:
    type: azuredevops:Feed
    properties:
      name: examplefeed
  exampleFeedRetentionPolicy:
    type: azuredevops:FeedRetentionPolicy
    name: example
    properties:
      feedId: ${example.id}
      countLimit: 20
      daysToKeepRecentlyDownloadedPackages: 30
Relevant Links
Create FeedRetentionPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FeedRetentionPolicy(name: string, args: FeedRetentionPolicyArgs, opts?: CustomResourceOptions);@overload
def FeedRetentionPolicy(resource_name: str,
                        args: FeedRetentionPolicyArgs,
                        opts: Optional[ResourceOptions] = None)
@overload
def FeedRetentionPolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        count_limit: Optional[int] = None,
                        days_to_keep_recently_downloaded_packages: Optional[int] = None,
                        feed_id: Optional[str] = None,
                        project_id: Optional[str] = None)func NewFeedRetentionPolicy(ctx *Context, name string, args FeedRetentionPolicyArgs, opts ...ResourceOption) (*FeedRetentionPolicy, error)public FeedRetentionPolicy(string name, FeedRetentionPolicyArgs args, CustomResourceOptions? opts = null)
public FeedRetentionPolicy(String name, FeedRetentionPolicyArgs args)
public FeedRetentionPolicy(String name, FeedRetentionPolicyArgs args, CustomResourceOptions options)
type: azuredevops:FeedRetentionPolicy
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 FeedRetentionPolicyArgs
- 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 FeedRetentionPolicyArgs
- 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 FeedRetentionPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FeedRetentionPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FeedRetentionPolicyArgs
- 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 feedRetentionPolicyResource = new AzureDevOps.FeedRetentionPolicy("feedRetentionPolicyResource", new()
{
    CountLimit = 0,
    DaysToKeepRecentlyDownloadedPackages = 0,
    FeedId = "string",
    ProjectId = "string",
});
example, err := azuredevops.NewFeedRetentionPolicy(ctx, "feedRetentionPolicyResource", &azuredevops.FeedRetentionPolicyArgs{
	CountLimit:                           pulumi.Int(0),
	DaysToKeepRecentlyDownloadedPackages: pulumi.Int(0),
	FeedId:                               pulumi.String("string"),
	ProjectId:                            pulumi.String("string"),
})
var feedRetentionPolicyResource = new FeedRetentionPolicy("feedRetentionPolicyResource", FeedRetentionPolicyArgs.builder()
    .countLimit(0)
    .daysToKeepRecentlyDownloadedPackages(0)
    .feedId("string")
    .projectId("string")
    .build());
feed_retention_policy_resource = azuredevops.FeedRetentionPolicy("feedRetentionPolicyResource",
    count_limit=0,
    days_to_keep_recently_downloaded_packages=0,
    feed_id="string",
    project_id="string")
const feedRetentionPolicyResource = new azuredevops.FeedRetentionPolicy("feedRetentionPolicyResource", {
    countLimit: 0,
    daysToKeepRecentlyDownloadedPackages: 0,
    feedId: "string",
    projectId: "string",
});
type: azuredevops:FeedRetentionPolicy
properties:
    countLimit: 0
    daysToKeepRecentlyDownloadedPackages: 0
    feedId: string
    projectId: string
FeedRetentionPolicy 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 FeedRetentionPolicy resource accepts the following input properties:
- CountLimit int
- The maximum number of versions per package.
- DaysTo intKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- FeedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- ProjectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- CountLimit int
- The maximum number of versions per package.
- DaysTo intKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- FeedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- ProjectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit Integer
- The maximum number of versions per package.
- daysTo IntegerKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId String
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId String
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit number
- The maximum number of versions per package.
- daysTo numberKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- count_limit int
- The maximum number of versions per package.
- days_to_ intkeep_ recently_ downloaded_ packages 
- The days to keep recently downloaded packages.
- feed_id str
- The ID of the Feed. Changing this forces a new resource to be created.
- project_id str
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit Number
- The maximum number of versions per package.
- daysTo NumberKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId String
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId String
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the FeedRetentionPolicy 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.
Look up Existing FeedRetentionPolicy Resource
Get an existing FeedRetentionPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FeedRetentionPolicyState, opts?: CustomResourceOptions): FeedRetentionPolicy@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        count_limit: Optional[int] = None,
        days_to_keep_recently_downloaded_packages: Optional[int] = None,
        feed_id: Optional[str] = None,
        project_id: Optional[str] = None) -> FeedRetentionPolicyfunc GetFeedRetentionPolicy(ctx *Context, name string, id IDInput, state *FeedRetentionPolicyState, opts ...ResourceOption) (*FeedRetentionPolicy, error)public static FeedRetentionPolicy Get(string name, Input<string> id, FeedRetentionPolicyState? state, CustomResourceOptions? opts = null)public static FeedRetentionPolicy get(String name, Output<String> id, FeedRetentionPolicyState state, CustomResourceOptions options)resources:  _:    type: azuredevops:FeedRetentionPolicy    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- CountLimit int
- The maximum number of versions per package.
- DaysTo intKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- FeedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- ProjectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- CountLimit int
- The maximum number of versions per package.
- DaysTo intKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- FeedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- ProjectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit Integer
- The maximum number of versions per package.
- daysTo IntegerKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId String
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId String
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit number
- The maximum number of versions per package.
- daysTo numberKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId string
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId string
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- count_limit int
- The maximum number of versions per package.
- days_to_ intkeep_ recently_ downloaded_ packages 
- The days to keep recently downloaded packages.
- feed_id str
- The ID of the Feed. Changing this forces a new resource to be created.
- project_id str
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
- countLimit Number
- The maximum number of versions per package.
- daysTo NumberKeep Recently Downloaded Packages 
- The days to keep recently downloaded packages.
- feedId String
- The ID of the Feed. Changing this forces a new resource to be created.
- projectId String
- The ID of the Project. If not specified, Feed will be created at the organization level. Changing this forces a new resource to be created.
Import
Azure DevOps Feed Retention Policy can be imported using the Project ID and Feed ID or Feed ID e.g.:
$ pulumi import azuredevops:index/feedRetentionPolicy:FeedRetentionPolicy example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
or
$ pulumi import azuredevops:index/feedRetentionPolicy:FeedRetentionPolicy example 00000000-0000-0000-0000-000000000000
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azuredevopsTerraform Provider.