1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. AnnouncementsService
  5. AnnouncementSubscriptionsActionsChangeCompartment
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.AnnouncementsService.AnnouncementSubscriptionsActionsChangeCompartment

Explore with Pulumi AI

This resource provides the Announcement Subscriptions Actions Change Compartment resource in Oracle Cloud Infrastructure Announcements Service service.

Moves the specified announcement subscription from one compartment to another compartment. When provided, If-Match is checked against ETag values of the resource.

This call is subject to an Announcements limit that applies to the total number of requests across all read or write operations. Announcements might throttle this call to reject an otherwise valid request when the total rate of operations exceeds 20 requests per second for a given user. The service might also throttle this call to reject an otherwise valid request when the total rate of operations exceeds 100 requests per second for a given tenancy.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAnnouncementSubscriptionsActionsChangeCompartment = new oci.announcementsservice.AnnouncementSubscriptionsActionsChangeCompartment("test_announcement_subscriptions_actions_change_compartment", {
    announcementSubscriptionId: testAnnouncementSubscription.id,
    compartmentId: compartmentId,
});
Copy
import pulumi
import pulumi_oci as oci

test_announcement_subscriptions_actions_change_compartment = oci.announcements_service.AnnouncementSubscriptionsActionsChangeCompartment("test_announcement_subscriptions_actions_change_compartment",
    announcement_subscription_id=test_announcement_subscription["id"],
    compartment_id=compartment_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/announcementsservice"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := announcementsservice.NewAnnouncementSubscriptionsActionsChangeCompartment(ctx, "test_announcement_subscriptions_actions_change_compartment", &announcementsservice.AnnouncementSubscriptionsActionsChangeCompartmentArgs{
			AnnouncementSubscriptionId: pulumi.Any(testAnnouncementSubscription.Id),
			CompartmentId:              pulumi.Any(compartmentId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testAnnouncementSubscriptionsActionsChangeCompartment = new Oci.AnnouncementsService.AnnouncementSubscriptionsActionsChangeCompartment("test_announcement_subscriptions_actions_change_compartment", new()
    {
        AnnouncementSubscriptionId = testAnnouncementSubscription.Id,
        CompartmentId = compartmentId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.AnnouncementsService.AnnouncementSubscriptionsActionsChangeCompartment;
import com.pulumi.oci.AnnouncementsService.AnnouncementSubscriptionsActionsChangeCompartmentArgs;
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 testAnnouncementSubscriptionsActionsChangeCompartment = new AnnouncementSubscriptionsActionsChangeCompartment("testAnnouncementSubscriptionsActionsChangeCompartment", AnnouncementSubscriptionsActionsChangeCompartmentArgs.builder()
            .announcementSubscriptionId(testAnnouncementSubscription.id())
            .compartmentId(compartmentId)
            .build());

    }
}
Copy
resources:
  testAnnouncementSubscriptionsActionsChangeCompartment:
    type: oci:AnnouncementsService:AnnouncementSubscriptionsActionsChangeCompartment
    name: test_announcement_subscriptions_actions_change_compartment
    properties:
      announcementSubscriptionId: ${testAnnouncementSubscription.id}
      compartmentId: ${compartmentId}
Copy

Create AnnouncementSubscriptionsActionsChangeCompartment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AnnouncementSubscriptionsActionsChangeCompartment(name: string, args: AnnouncementSubscriptionsActionsChangeCompartmentArgs, opts?: CustomResourceOptions);
@overload
def AnnouncementSubscriptionsActionsChangeCompartment(resource_name: str,
                                                      args: AnnouncementSubscriptionsActionsChangeCompartmentArgs,
                                                      opts: Optional[ResourceOptions] = None)

@overload
def AnnouncementSubscriptionsActionsChangeCompartment(resource_name: str,
                                                      opts: Optional[ResourceOptions] = None,
                                                      announcement_subscription_id: Optional[str] = None,
                                                      compartment_id: Optional[str] = None)
func NewAnnouncementSubscriptionsActionsChangeCompartment(ctx *Context, name string, args AnnouncementSubscriptionsActionsChangeCompartmentArgs, opts ...ResourceOption) (*AnnouncementSubscriptionsActionsChangeCompartment, error)
public AnnouncementSubscriptionsActionsChangeCompartment(string name, AnnouncementSubscriptionsActionsChangeCompartmentArgs args, CustomResourceOptions? opts = null)
public AnnouncementSubscriptionsActionsChangeCompartment(String name, AnnouncementSubscriptionsActionsChangeCompartmentArgs args)
public AnnouncementSubscriptionsActionsChangeCompartment(String name, AnnouncementSubscriptionsActionsChangeCompartmentArgs args, CustomResourceOptions options)
type: oci:AnnouncementsService:AnnouncementSubscriptionsActionsChangeCompartment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AnnouncementSubscriptionsActionsChangeCompartmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AnnouncementSubscriptionsActionsChangeCompartmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AnnouncementSubscriptionsActionsChangeCompartmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AnnouncementSubscriptionsActionsChangeCompartmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AnnouncementSubscriptionsActionsChangeCompartmentArgs
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 announcementSubscriptionsActionsChangeCompartmentResource = new Oci.AnnouncementsService.AnnouncementSubscriptionsActionsChangeCompartment("announcementSubscriptionsActionsChangeCompartmentResource", new()
{
    AnnouncementSubscriptionId = "string",
    CompartmentId = "string",
});
Copy
example, err := announcementsservice.NewAnnouncementSubscriptionsActionsChangeCompartment(ctx, "announcementSubscriptionsActionsChangeCompartmentResource", &announcementsservice.AnnouncementSubscriptionsActionsChangeCompartmentArgs{
	AnnouncementSubscriptionId: pulumi.String("string"),
	CompartmentId:              pulumi.String("string"),
})
Copy
var announcementSubscriptionsActionsChangeCompartmentResource = new AnnouncementSubscriptionsActionsChangeCompartment("announcementSubscriptionsActionsChangeCompartmentResource", AnnouncementSubscriptionsActionsChangeCompartmentArgs.builder()
    .announcementSubscriptionId("string")
    .compartmentId("string")
    .build());
Copy
announcement_subscriptions_actions_change_compartment_resource = oci.announcements_service.AnnouncementSubscriptionsActionsChangeCompartment("announcementSubscriptionsActionsChangeCompartmentResource",
    announcement_subscription_id="string",
    compartment_id="string")
Copy
const announcementSubscriptionsActionsChangeCompartmentResource = new oci.announcementsservice.AnnouncementSubscriptionsActionsChangeCompartment("announcementSubscriptionsActionsChangeCompartmentResource", {
    announcementSubscriptionId: "string",
    compartmentId: "string",
});
Copy
type: oci:AnnouncementsService:AnnouncementSubscriptionsActionsChangeCompartment
properties:
    announcementSubscriptionId: string
    compartmentId: string
Copy

AnnouncementSubscriptionsActionsChangeCompartment 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 AnnouncementSubscriptionsActionsChangeCompartment resource accepts the following input properties:

AnnouncementSubscriptionId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the announcement subscription.
CompartmentId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

AnnouncementSubscriptionId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the announcement subscription.
CompartmentId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the announcement subscription.
compartmentId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the announcement subscription.
compartmentId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcement_subscription_id
This property is required.
Changes to this property will trigger replacement.
str
The OCID of the announcement subscription.
compartment_id
This property is required.
Changes to this property will trigger replacement.
str

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the announcement subscription.
compartmentId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

All input properties are implicitly available as output properties. Additionally, the AnnouncementSubscriptionsActionsChangeCompartment 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 AnnouncementSubscriptionsActionsChangeCompartment Resource

Get an existing AnnouncementSubscriptionsActionsChangeCompartment 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?: AnnouncementSubscriptionsActionsChangeCompartmentState, opts?: CustomResourceOptions): AnnouncementSubscriptionsActionsChangeCompartment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        announcement_subscription_id: Optional[str] = None,
        compartment_id: Optional[str] = None) -> AnnouncementSubscriptionsActionsChangeCompartment
func GetAnnouncementSubscriptionsActionsChangeCompartment(ctx *Context, name string, id IDInput, state *AnnouncementSubscriptionsActionsChangeCompartmentState, opts ...ResourceOption) (*AnnouncementSubscriptionsActionsChangeCompartment, error)
public static AnnouncementSubscriptionsActionsChangeCompartment Get(string name, Input<string> id, AnnouncementSubscriptionsActionsChangeCompartmentState? state, CustomResourceOptions? opts = null)
public static AnnouncementSubscriptionsActionsChangeCompartment get(String name, Output<String> id, AnnouncementSubscriptionsActionsChangeCompartmentState state, CustomResourceOptions options)
resources:  _:    type: oci:AnnouncementsService:AnnouncementSubscriptionsActionsChangeCompartment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
AnnouncementSubscriptionId Changes to this property will trigger replacement. string
The OCID of the announcement subscription.
CompartmentId Changes to this property will trigger replacement. string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

AnnouncementSubscriptionId Changes to this property will trigger replacement. string
The OCID of the announcement subscription.
CompartmentId Changes to this property will trigger replacement. string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId Changes to this property will trigger replacement. String
The OCID of the announcement subscription.
compartmentId Changes to this property will trigger replacement. String

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId Changes to this property will trigger replacement. string
The OCID of the announcement subscription.
compartmentId Changes to this property will trigger replacement. string

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcement_subscription_id Changes to this property will trigger replacement. str
The OCID of the announcement subscription.
compartment_id Changes to this property will trigger replacement. str

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

announcementSubscriptionId Changes to this property will trigger replacement. String
The OCID of the announcement subscription.
compartmentId Changes to this property will trigger replacement. String

The OCID of the compartment into which you want to move the announcement subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Import

AnnouncementSubscriptionsActionsChangeCompartment can be imported using the id, e.g.

$ pulumi import oci:AnnouncementsService/announcementSubscriptionsActionsChangeCompartment:AnnouncementSubscriptionsActionsChangeCompartment test_announcement_subscriptions_actions_change_compartment "id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.