diff --git a/provider/cmd/pulumi-resource-newrelic/bridge-metadata.json b/provider/cmd/pulumi-resource-newrelic/bridge-metadata.json index 63326d19..9b89a20d 100644 --- a/provider/cmd/pulumi-resource-newrelic/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-newrelic/bridge-metadata.json @@ -1241,6 +1241,10 @@ "current": "newrelic:cloud/gcpLinkAccount:GcpLinkAccount", "majorVersion": 5 }, + "newrelic_cloud_oci_link_account": { + "current": "newrelic:cloud/ociLinkAccount:OciLinkAccount", + "majorVersion": 5 + }, "newrelic_data_partition_rule": { "current": "newrelic:index/dataPartitionRule:DataPartitionRule", "majorVersion": 5 @@ -4452,6 +4456,11 @@ "account_id", "project_id" ], + "newrelic_cloud_oci_link_account": [ + "account_id", + "oci_client_id", + "tenant_id" + ], "newrelic_data_partition_rule": [ "account_id" ], diff --git a/provider/cmd/pulumi-resource-newrelic/schema.json b/provider/cmd/pulumi-resource-newrelic/schema.json index ff1c4732..d4068616 100644 --- a/provider/cmd/pulumi-resource-newrelic/schema.json +++ b/provider/cmd/pulumi-resource-newrelic/schema.json @@ -10605,6 +10605,226 @@ "type": "object" } }, + "newrelic:cloud/ociLinkAccount:OciLinkAccount": { + "description": "Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic.\n\nThis setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console.\n\n## Prerequisites\n\nFor the `newrelic.cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions.\n\n\u003e NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials. \n\u003e See Getting Started: New Relic provider guide\n\nIf you encounter issues or bugs, please open an issue in the GitHub repository.\n\n### Workload Identity Federation (WIF) Attributes\n\nThe following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `oci_client_id`, `oci_client_secret`, `oci_domain_url`, and `oci_svc_user_name`.\n\nTo create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange:\n\n[Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust)\n\nWIF configuration steps:\n1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion.\n2. Generate / record the client ID (`oci_client_id`) and client secret (`oci_client_secret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingest_vault_ocid` / `user_vault_ocid` if desired).\n3. Use the Identity Domain base URL as `oci_domain_url` (format: `https://idcs-\u003chash\u003e.identity.oraclecloud.com`).\n4. Provide / map a service user (or principal) used for workload identity federation as `oci_svc_user_name`.\n5. Ensure the client has the required scopes and the tenancy policies allow the token exchange.\n\n\u003e TIP: Rotating the OAuth2 client secret only requires updating `oci_client_secret`; it does not force resource replacement.\n\n## Example Usage\n\nMinimal example (required arguments for creation):\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as newrelic from \"@pulumi/newrelic\";\n\nconst example = new newrelic.cloud.OciLinkAccount(\"example\", {\n accountId: \"1234567\",\n tenantId: \"ocid1.tenancy.oc1..aaaaaaaaexample\",\n name: \"my-oci-link\",\n compartmentOcid: \"ocid1.compartment.oc1..bbbbbbbbexample\",\n ociClientId: \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n ociClientSecret: ociClientSecret,\n ociDomainUrl: \"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n ociHomeRegion: \"us-ashburn-1\",\n ociSvcUserName: \"svc-newrelic-collector\",\n});\n```\n```python\nimport pulumi\nimport pulumi_newrelic as newrelic\n\nexample = newrelic.cloud.OciLinkAccount(\"example\",\n account_id=\"1234567\",\n tenant_id=\"ocid1.tenancy.oc1..aaaaaaaaexample\",\n name=\"my-oci-link\",\n compartment_ocid=\"ocid1.compartment.oc1..bbbbbbbbexample\",\n oci_client_id=\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n oci_client_secret=oci_client_secret,\n oci_domain_url=\"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n oci_home_region=\"us-ashburn-1\",\n oci_svc_user_name=\"svc-newrelic-collector\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing NewRelic = Pulumi.NewRelic;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new NewRelic.Cloud.OciLinkAccount(\"example\", new()\n {\n AccountId = \"1234567\",\n TenantId = \"ocid1.tenancy.oc1..aaaaaaaaexample\",\n Name = \"my-oci-link\",\n CompartmentOcid = \"ocid1.compartment.oc1..bbbbbbbbexample\",\n OciClientId = \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n OciClientSecret = ociClientSecret,\n OciDomainUrl = \"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n OciHomeRegion = \"us-ashburn-1\",\n OciSvcUserName = \"svc-newrelic-collector\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/cloud\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := cloud.NewOciLinkAccount(ctx, \"example\", \u0026cloud.OciLinkAccountArgs{\n\t\t\tAccountId: pulumi.String(\"1234567\"),\n\t\t\tTenantId: pulumi.String(\"ocid1.tenancy.oc1..aaaaaaaaexample\"),\n\t\t\tName: pulumi.String(\"my-oci-link\"),\n\t\t\tCompartmentOcid: pulumi.String(\"ocid1.compartment.oc1..bbbbbbbbexample\"),\n\t\t\tOciClientId: pulumi.String(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"),\n\t\t\tOciClientSecret: pulumi.Any(ociClientSecret),\n\t\t\tOciDomainUrl: pulumi.String(\"https://idcs-1234567890abcdef.identity.oraclecloud.com\"),\n\t\t\tOciHomeRegion: pulumi.String(\"us-ashburn-1\"),\n\t\t\tOciSvcUserName: pulumi.String(\"svc-newrelic-collector\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.newrelic.cloud.OciLinkAccount;\nimport com.pulumi.newrelic.cloud.OciLinkAccountArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new OciLinkAccount(\"example\", OciLinkAccountArgs.builder()\n .accountId(\"1234567\")\n .tenantId(\"ocid1.tenancy.oc1..aaaaaaaaexample\")\n .name(\"my-oci-link\")\n .compartmentOcid(\"ocid1.compartment.oc1..bbbbbbbbexample\")\n .ociClientId(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\")\n .ociClientSecret(ociClientSecret)\n .ociDomainUrl(\"https://idcs-1234567890abcdef.identity.oraclecloud.com\")\n .ociHomeRegion(\"us-ashburn-1\")\n .ociSvcUserName(\"svc-newrelic-collector\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: newrelic:cloud:OciLinkAccount\n properties:\n accountId: 1.234567e+06 # Changing this forces replacement (ForceNew)\n tenantId: ocid1.tenancy.oc1..aaaaaaaaexample\n name: my-oci-link\n compartmentOcid: ocid1.compartment.oc1..bbbbbbbbexample\n ociClientId: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\n ociClientSecret: ${ociClientSecret}\n ociDomainUrl: https://idcs-1234567890abcdef.identity.oraclecloud.com\n ociHomeRegion: us-ashburn-1\n ociSvcUserName: svc-newrelic-collector\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\nExample including optional secret references and update-only fields:\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as newrelic from \"@pulumi/newrelic\";\n\nconst full = new newrelic.cloud.OciLinkAccount(\"full\", {\n name: \"my-oci-link-full\",\n tenantId: \"ocid1.tenancy.oc1..aaaaaaaaexample\",\n compartmentOcid: \"ocid1.compartment.oc1..bbbbbbbbexample\",\n ociClientId: \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n ociClientSecret: ociClientSecret,\n ociDomainUrl: \"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n ociHomeRegion: \"us-ashburn-1\",\n ociSvcUserName: \"svc-newrelic-collector\",\n ingestVaultOcid: \"ocid1.vaultsecret.oc1..ccccccccexample\",\n userVaultOcid: \"ocid1.vaultsecret.oc1..ddddddddexample\",\n instrumentationType: \"METRICS,LOGS\",\n ociRegion: \"us-phoenix-1\",\n metricStackOcid: \"ocid1.stack.oc1..eeeeeeeeexample\",\n loggingStackOcid: \"ocid1.stack.oc1..ffffffloggingstack\",\n});\n```\n```python\nimport pulumi\nimport pulumi_newrelic as newrelic\n\nfull = newrelic.cloud.OciLinkAccount(\"full\",\n name=\"my-oci-link-full\",\n tenant_id=\"ocid1.tenancy.oc1..aaaaaaaaexample\",\n compartment_ocid=\"ocid1.compartment.oc1..bbbbbbbbexample\",\n oci_client_id=\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n oci_client_secret=oci_client_secret,\n oci_domain_url=\"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n oci_home_region=\"us-ashburn-1\",\n oci_svc_user_name=\"svc-newrelic-collector\",\n ingest_vault_ocid=\"ocid1.vaultsecret.oc1..ccccccccexample\",\n user_vault_ocid=\"ocid1.vaultsecret.oc1..ddddddddexample\",\n instrumentation_type=\"METRICS,LOGS\",\n oci_region=\"us-phoenix-1\",\n metric_stack_ocid=\"ocid1.stack.oc1..eeeeeeeeexample\",\n logging_stack_ocid=\"ocid1.stack.oc1..ffffffloggingstack\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing NewRelic = Pulumi.NewRelic;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var full = new NewRelic.Cloud.OciLinkAccount(\"full\", new()\n {\n Name = \"my-oci-link-full\",\n TenantId = \"ocid1.tenancy.oc1..aaaaaaaaexample\",\n CompartmentOcid = \"ocid1.compartment.oc1..bbbbbbbbexample\",\n OciClientId = \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n OciClientSecret = ociClientSecret,\n OciDomainUrl = \"https://idcs-1234567890abcdef.identity.oraclecloud.com\",\n OciHomeRegion = \"us-ashburn-1\",\n OciSvcUserName = \"svc-newrelic-collector\",\n IngestVaultOcid = \"ocid1.vaultsecret.oc1..ccccccccexample\",\n UserVaultOcid = \"ocid1.vaultsecret.oc1..ddddddddexample\",\n InstrumentationType = \"METRICS,LOGS\",\n OciRegion = \"us-phoenix-1\",\n MetricStackOcid = \"ocid1.stack.oc1..eeeeeeeeexample\",\n LoggingStackOcid = \"ocid1.stack.oc1..ffffffloggingstack\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/cloud\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := cloud.NewOciLinkAccount(ctx, \"full\", \u0026cloud.OciLinkAccountArgs{\n\t\t\tName: pulumi.String(\"my-oci-link-full\"),\n\t\t\tTenantId: pulumi.String(\"ocid1.tenancy.oc1..aaaaaaaaexample\"),\n\t\t\tCompartmentOcid: pulumi.String(\"ocid1.compartment.oc1..bbbbbbbbexample\"),\n\t\t\tOciClientId: pulumi.String(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"),\n\t\t\tOciClientSecret: pulumi.Any(ociClientSecret),\n\t\t\tOciDomainUrl: pulumi.String(\"https://idcs-1234567890abcdef.identity.oraclecloud.com\"),\n\t\t\tOciHomeRegion: pulumi.String(\"us-ashburn-1\"),\n\t\t\tOciSvcUserName: pulumi.String(\"svc-newrelic-collector\"),\n\t\t\tIngestVaultOcid: pulumi.String(\"ocid1.vaultsecret.oc1..ccccccccexample\"),\n\t\t\tUserVaultOcid: pulumi.String(\"ocid1.vaultsecret.oc1..ddddddddexample\"),\n\t\t\tInstrumentationType: pulumi.String(\"METRICS,LOGS\"),\n\t\t\tOciRegion: pulumi.String(\"us-phoenix-1\"),\n\t\t\tMetricStackOcid: pulumi.String(\"ocid1.stack.oc1..eeeeeeeeexample\"),\n\t\t\tLoggingStackOcid: pulumi.String(\"ocid1.stack.oc1..ffffffloggingstack\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.newrelic.cloud.OciLinkAccount;\nimport com.pulumi.newrelic.cloud.OciLinkAccountArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var full = new OciLinkAccount(\"full\", OciLinkAccountArgs.builder()\n .name(\"my-oci-link-full\")\n .tenantId(\"ocid1.tenancy.oc1..aaaaaaaaexample\")\n .compartmentOcid(\"ocid1.compartment.oc1..bbbbbbbbexample\")\n .ociClientId(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\")\n .ociClientSecret(ociClientSecret)\n .ociDomainUrl(\"https://idcs-1234567890abcdef.identity.oraclecloud.com\")\n .ociHomeRegion(\"us-ashburn-1\")\n .ociSvcUserName(\"svc-newrelic-collector\")\n .ingestVaultOcid(\"ocid1.vaultsecret.oc1..ccccccccexample\")\n .userVaultOcid(\"ocid1.vaultsecret.oc1..ddddddddexample\")\n .instrumentationType(\"METRICS,LOGS\")\n .ociRegion(\"us-phoenix-1\")\n .metricStackOcid(\"ocid1.stack.oc1..eeeeeeeeexample\")\n .loggingStackOcid(\"ocid1.stack.oc1..ffffffloggingstack\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n full:\n type: newrelic:cloud:OciLinkAccount\n properties:\n name: my-oci-link-full\n tenantId: ocid1.tenancy.oc1..aaaaaaaaexample\n compartmentOcid: ocid1.compartment.oc1..bbbbbbbbexample\n ociClientId: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\n ociClientSecret: ${ociClientSecret}\n ociDomainUrl: https://idcs-1234567890abcdef.identity.oraclecloud.com\n ociHomeRegion: us-ashburn-1\n ociSvcUserName: svc-newrelic-collector\n ingestVaultOcid: ocid1.vaultsecret.oc1..ccccccccexample\n userVaultOcid: ocid1.vaultsecret.oc1..ddddddddexample\n instrumentationType: METRICS,LOGS\n ociRegion: us-phoenix-1\n metricStackOcid: ocid1.stack.oc1..eeeeeeeeexample\n loggingStackOcid: ocid1.stack.oc1..ffffffloggingstack\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nLinked OCI accounts can be imported using the `id`, e.g.\n\nbash\n\n```sh\n$ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo \u003cid\u003e\n```\n\n", + "properties": { + "accountId": { + "type": "string", + "description": "New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`.\n" + }, + "compartmentOcid": { + "type": "string", + "description": "OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment.\n" + }, + "ingestVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing an ingest secret.\n" + }, + "instrumentationType": { + "type": "string", + "description": "Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`).\n" + }, + "loggingStackOcid": { + "type": "string", + "description": "The Logging stack identifier for the OCI account.\n" + }, + "metricStackOcid": { + "type": "string", + "description": "Metric stack OCID (ignored on create, applied on update).\n" + }, + "name": { + "type": "string", + "description": "Display name for the linked account.\n" + }, + "ociClientId": { + "type": "string", + "description": "OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation.\n" + }, + "ociClientSecret": { + "type": "string", + "description": "OAuth2 client secret. Not displayed in plans or state outputs.\n", + "secret": true + }, + "ociDomainUrl": { + "type": "string", + "description": "Base URL of the OCI Identity Domain (e.g. `https://idcs-\u003chash\u003e.identity.oraclecloud.com`).\n" + }, + "ociHomeRegion": { + "type": "string", + "description": "Home region of the tenancy (e.g. `us-ashburn-1`).\n" + }, + "ociRegion": { + "type": "string", + "description": "OCI region for the linkage (ignored on create, applied on update).\n" + }, + "ociSvcUserName": { + "type": "string", + "description": "Service user name associated with the WIF configuration.\n" + }, + "tenantId": { + "type": "string", + "description": "OCI tenancy OCID (root tenancy). Changing forces a new linked account.\n" + }, + "userVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing a user or auxiliary secret.\n" + } + }, + "required": [ + "accountId", + "compartmentOcid", + "name", + "ociClientId", + "ociClientSecret", + "ociDomainUrl", + "ociHomeRegion", + "ociSvcUserName", + "tenantId" + ], + "inputProperties": { + "accountId": { + "type": "string", + "description": "New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`.\n", + "willReplaceOnChanges": true + }, + "compartmentOcid": { + "type": "string", + "description": "OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment.\n" + }, + "ingestVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing an ingest secret.\n" + }, + "instrumentationType": { + "type": "string", + "description": "Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`).\n" + }, + "loggingStackOcid": { + "type": "string", + "description": "The Logging stack identifier for the OCI account.\n" + }, + "metricStackOcid": { + "type": "string", + "description": "Metric stack OCID (ignored on create, applied on update).\n" + }, + "name": { + "type": "string", + "description": "Display name for the linked account.\n" + }, + "ociClientId": { + "type": "string", + "description": "OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation.\n" + }, + "ociClientSecret": { + "type": "string", + "description": "OAuth2 client secret. Not displayed in plans or state outputs.\n", + "secret": true + }, + "ociDomainUrl": { + "type": "string", + "description": "Base URL of the OCI Identity Domain (e.g. `https://idcs-\u003chash\u003e.identity.oraclecloud.com`).\n" + }, + "ociHomeRegion": { + "type": "string", + "description": "Home region of the tenancy (e.g. `us-ashburn-1`).\n" + }, + "ociRegion": { + "type": "string", + "description": "OCI region for the linkage (ignored on create, applied on update).\n" + }, + "ociSvcUserName": { + "type": "string", + "description": "Service user name associated with the WIF configuration.\n" + }, + "tenantId": { + "type": "string", + "description": "OCI tenancy OCID (root tenancy). Changing forces a new linked account.\n", + "willReplaceOnChanges": true + }, + "userVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing a user or auxiliary secret.\n" + } + }, + "requiredInputs": [ + "compartmentOcid", + "ociClientId", + "ociClientSecret", + "ociDomainUrl", + "ociHomeRegion", + "ociSvcUserName", + "tenantId" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering OciLinkAccount resources.\n", + "properties": { + "accountId": { + "type": "string", + "description": "New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`.\n", + "willReplaceOnChanges": true + }, + "compartmentOcid": { + "type": "string", + "description": "OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment.\n" + }, + "ingestVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing an ingest secret.\n" + }, + "instrumentationType": { + "type": "string", + "description": "Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`).\n" + }, + "loggingStackOcid": { + "type": "string", + "description": "The Logging stack identifier for the OCI account.\n" + }, + "metricStackOcid": { + "type": "string", + "description": "Metric stack OCID (ignored on create, applied on update).\n" + }, + "name": { + "type": "string", + "description": "Display name for the linked account.\n" + }, + "ociClientId": { + "type": "string", + "description": "OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation.\n" + }, + "ociClientSecret": { + "type": "string", + "description": "OAuth2 client secret. Not displayed in plans or state outputs.\n", + "secret": true + }, + "ociDomainUrl": { + "type": "string", + "description": "Base URL of the OCI Identity Domain (e.g. `https://idcs-\u003chash\u003e.identity.oraclecloud.com`).\n" + }, + "ociHomeRegion": { + "type": "string", + "description": "Home region of the tenancy (e.g. `us-ashburn-1`).\n" + }, + "ociRegion": { + "type": "string", + "description": "OCI region for the linkage (ignored on create, applied on update).\n" + }, + "ociSvcUserName": { + "type": "string", + "description": "Service user name associated with the WIF configuration.\n" + }, + "tenantId": { + "type": "string", + "description": "OCI tenancy OCID (root tenancy). Changing forces a new linked account.\n", + "willReplaceOnChanges": true + }, + "userVaultOcid": { + "type": "string", + "description": "Vault secret OCID containing a user or auxiliary secret.\n" + } + }, + "type": "object" + } + }, "newrelic:index/accountManagement:AccountManagement": { "description": "Use this resource to create and manage New Relic sub accounts.\n\n\u003e **WARNING:** The `newrelic.AccountManagement` resource will only create/update but won't delete a sub account. Please visit our documentation on [`Account Management`](https://docs.newrelic.com/docs/apis/nerdgraph/examples/manage-accounts-nerdgraph/#delete) for more information .\n\n## Example Usage\n\n##### Create Account\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as newrelic from \"@pulumi/newrelic\";\n\nconst foo = new newrelic.AccountManagement(\"foo\", {\n name: \"Test Account Name\",\n region: \"us01\",\n});\n```\n```python\nimport pulumi\nimport pulumi_newrelic as newrelic\n\nfoo = newrelic.AccountManagement(\"foo\",\n name=\"Test Account Name\",\n region=\"us01\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing NewRelic = Pulumi.NewRelic;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var foo = new NewRelic.AccountManagement(\"foo\", new()\n {\n Name = \"Test Account Name\",\n Region = \"us01\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := newrelic.NewAccountManagement(ctx, \"foo\", \u0026newrelic.AccountManagementArgs{\n\t\t\tName: pulumi.String(\"Test Account Name\"),\n\t\t\tRegion: pulumi.String(\"us01\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.newrelic.AccountManagement;\nimport com.pulumi.newrelic.AccountManagementArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var foo = new AccountManagement(\"foo\", AccountManagementArgs.builder()\n .name(\"Test Account Name\")\n .region(\"us01\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n foo:\n type: newrelic:AccountManagement\n properties:\n name: Test Account Name\n region: us01\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nAccounts can be imported using the `id`, e.g.\n\nbash\n\n```sh\n$ pulumi import newrelic:index/accountManagement:AccountManagement foo \u003cid\u003e\n```\n\n", "properties": { diff --git a/provider/go.mod b/provider/go.mod index a6ed175a..72d24a3d 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -132,7 +132,7 @@ require ( github.com/natefinch/atomic v1.0.1 // indirect github.com/newrelic/go-agent/v3 v3.30.0 // indirect github.com/newrelic/go-insights v1.0.3 // indirect - github.com/newrelic/newrelic-client-go/v2 v2.69.0 // indirect + github.com/newrelic/newrelic-client-go/v2 v2.70.0 // indirect github.com/nxadm/tail v1.4.11 // indirect github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect diff --git a/provider/go.sum b/provider/go.sum index a6eb710a..fd4e89dc 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2162,8 +2162,8 @@ github.com/newrelic/go-agent/v3 v3.30.0 h1:ZXHCT/Cot4iIPwcegCZURuRQOsfmGA6wilW+S github.com/newrelic/go-agent/v3 v3.30.0/go.mod h1:9utrgxlSryNqRrTvII2XBL+0lpofXbqXApvVWPpbzUg= github.com/newrelic/go-insights v1.0.3 h1:zSNp1CEZnXktzSIEsbHJk8v6ZihdPFP2WsO/fzau3OQ= github.com/newrelic/go-insights v1.0.3/go.mod h1:A20BoT8TNkqPGX2nS/Z2fYmKl3Cqa3iKZd4whzedCY4= -github.com/newrelic/newrelic-client-go/v2 v2.69.0 h1:jwSNy7L3Z09f+RCrAJuvruQpnGk81lRairbGoILY0ss= -github.com/newrelic/newrelic-client-go/v2 v2.69.0/go.mod h1:P6rXSHPtayzr50+UEYvvjzYPiADv7w2SqeyKz0z5HkU= +github.com/newrelic/newrelic-client-go/v2 v2.70.0 h1:O6nmfS4QND+0zEJ8aTc7FTYC4esCi/2sjVja4wtrolo= +github.com/newrelic/newrelic-client-go/v2 v2.70.0/go.mod h1:P6rXSHPtayzr50+UEYvvjzYPiADv7w2SqeyKz0z5HkU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA= github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI= diff --git a/sdk/dotnet/Cloud/OciLinkAccount.cs b/sdk/dotnet/Cloud/OciLinkAccount.cs new file mode 100644 index 00000000..4ed701e9 --- /dev/null +++ b/sdk/dotnet/Cloud/OciLinkAccount.cs @@ -0,0 +1,468 @@ +// *** WARNING: this file was generated by pulumi-language-dotnet. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.NewRelic.Cloud +{ + /// + /// Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. + /// + /// This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. + /// + /// ## Prerequisites + /// + /// For the `newrelic.cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. + /// + /// > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\ + /// See Getting Started: New Relic provider guide + /// + /// If you encounter issues or bugs, please open an issue in the GitHub repository. + /// + /// ### Workload Identity Federation (WIF) Attributes + /// + /// The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `oci_client_id`, `oci_client_secret`, `oci_domain_url`, and `oci_svc_user_name`. + /// + /// To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: + /// + /// [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) + /// + /// WIF configuration steps: + /// 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. + /// 2. Generate / record the client ID (`oci_client_id`) and client secret (`oci_client_secret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingest_vault_ocid` / `user_vault_ocid` if desired). + /// 3. Use the Identity Domain base URL as `oci_domain_url` (format: `https://idcs-<hash>.identity.oraclecloud.com`). + /// 4. Provide / map a service user (or principal) used for workload identity federation as `oci_svc_user_name`. + /// 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. + /// + /// > TIP: Rotating the OAuth2 client secret only requires updating `oci_client_secret`; it does not force resource replacement. + /// + /// ## Example Usage + /// + /// Minimal example (required arguments for creation): + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using NewRelic = Pulumi.NewRelic; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new NewRelic.Cloud.OciLinkAccount("example", new() + /// { + /// AccountId = "1234567", + /// TenantId = "ocid1.tenancy.oc1..aaaaaaaaexample", + /// Name = "my-oci-link", + /// CompartmentOcid = "ocid1.compartment.oc1..bbbbbbbbexample", + /// OciClientId = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + /// OciClientSecret = ociClientSecret, + /// OciDomainUrl = "https://idcs-1234567890abcdef.identity.oraclecloud.com", + /// OciHomeRegion = "us-ashburn-1", + /// OciSvcUserName = "svc-newrelic-collector", + /// }); + /// + /// }); + /// ``` + /// + /// Example including optional secret references and update-only fields: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using NewRelic = Pulumi.NewRelic; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var full = new NewRelic.Cloud.OciLinkAccount("full", new() + /// { + /// Name = "my-oci-link-full", + /// TenantId = "ocid1.tenancy.oc1..aaaaaaaaexample", + /// CompartmentOcid = "ocid1.compartment.oc1..bbbbbbbbexample", + /// OciClientId = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + /// OciClientSecret = ociClientSecret, + /// OciDomainUrl = "https://idcs-1234567890abcdef.identity.oraclecloud.com", + /// OciHomeRegion = "us-ashburn-1", + /// OciSvcUserName = "svc-newrelic-collector", + /// IngestVaultOcid = "ocid1.vaultsecret.oc1..ccccccccexample", + /// UserVaultOcid = "ocid1.vaultsecret.oc1..ddddddddexample", + /// InstrumentationType = "METRICS,LOGS", + /// OciRegion = "us-phoenix-1", + /// MetricStackOcid = "ocid1.stack.oc1..eeeeeeeeexample", + /// LoggingStackOcid = "ocid1.stack.oc1..ffffffloggingstack", + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// Linked OCI accounts can be imported using the `id`, e.g. + /// + /// bash + /// + /// ```sh + /// $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo <id> + /// ``` + /// + [NewRelicResourceType("newrelic:cloud/ociLinkAccount:OciLinkAccount")] + public partial class OciLinkAccount : global::Pulumi.CustomResource + { + /// + /// New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + /// + [Output("accountId")] + public Output AccountId { get; private set; } = null!; + + /// + /// OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + /// + [Output("compartmentOcid")] + public Output CompartmentOcid { get; private set; } = null!; + + /// + /// Vault secret OCID containing an ingest secret. + /// + [Output("ingestVaultOcid")] + public Output IngestVaultOcid { get; private set; } = null!; + + /// + /// Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + /// + [Output("instrumentationType")] + public Output InstrumentationType { get; private set; } = null!; + + /// + /// The Logging stack identifier for the OCI account. + /// + [Output("loggingStackOcid")] + public Output LoggingStackOcid { get; private set; } = null!; + + /// + /// Metric stack OCID (ignored on create, applied on update). + /// + [Output("metricStackOcid")] + public Output MetricStackOcid { get; private set; } = null!; + + /// + /// Display name for the linked account. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + /// + [Output("ociClientId")] + public Output OciClientId { get; private set; } = null!; + + /// + /// OAuth2 client secret. Not displayed in plans or state outputs. + /// + [Output("ociClientSecret")] + public Output OciClientSecret { get; private set; } = null!; + + /// + /// Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + /// + [Output("ociDomainUrl")] + public Output OciDomainUrl { get; private set; } = null!; + + /// + /// Home region of the tenancy (e.g. `us-ashburn-1`). + /// + [Output("ociHomeRegion")] + public Output OciHomeRegion { get; private set; } = null!; + + /// + /// OCI region for the linkage (ignored on create, applied on update). + /// + [Output("ociRegion")] + public Output OciRegion { get; private set; } = null!; + + /// + /// Service user name associated with the WIF configuration. + /// + [Output("ociSvcUserName")] + public Output OciSvcUserName { get; private set; } = null!; + + /// + /// OCI tenancy OCID (root tenancy). Changing forces a new linked account. + /// + [Output("tenantId")] + public Output TenantId { get; private set; } = null!; + + /// + /// Vault secret OCID containing a user or auxiliary secret. + /// + [Output("userVaultOcid")] + public Output UserVaultOcid { get; private set; } = null!; + + + /// + /// Create a OciLinkAccount resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public OciLinkAccount(string name, OciLinkAccountArgs args, CustomResourceOptions? options = null) + : base("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, args ?? new OciLinkAccountArgs(), MakeResourceOptions(options, "")) + { + } + + private OciLinkAccount(string name, Input id, OciLinkAccountState? state = null, CustomResourceOptions? options = null) + : base("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + AdditionalSecretOutputs = + { + "ociClientSecret", + }, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing OciLinkAccount resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static OciLinkAccount Get(string name, Input id, OciLinkAccountState? state = null, CustomResourceOptions? options = null) + { + return new OciLinkAccount(name, id, state, options); + } + } + + public sealed class OciLinkAccountArgs : global::Pulumi.ResourceArgs + { + /// + /// New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + /// + [Input("accountId")] + public Input? AccountId { get; set; } + + /// + /// OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + /// + [Input("compartmentOcid", required: true)] + public Input CompartmentOcid { get; set; } = null!; + + /// + /// Vault secret OCID containing an ingest secret. + /// + [Input("ingestVaultOcid")] + public Input? IngestVaultOcid { get; set; } + + /// + /// Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + /// + [Input("instrumentationType")] + public Input? InstrumentationType { get; set; } + + /// + /// The Logging stack identifier for the OCI account. + /// + [Input("loggingStackOcid")] + public Input? LoggingStackOcid { get; set; } + + /// + /// Metric stack OCID (ignored on create, applied on update). + /// + [Input("metricStackOcid")] + public Input? MetricStackOcid { get; set; } + + /// + /// Display name for the linked account. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + /// + [Input("ociClientId", required: true)] + public Input OciClientId { get; set; } = null!; + + [Input("ociClientSecret", required: true)] + private Input? _ociClientSecret; + + /// + /// OAuth2 client secret. Not displayed in plans or state outputs. + /// + public Input? OciClientSecret + { + get => _ociClientSecret; + set + { + var emptySecret = Output.CreateSecret(0); + _ociClientSecret = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + /// + [Input("ociDomainUrl", required: true)] + public Input OciDomainUrl { get; set; } = null!; + + /// + /// Home region of the tenancy (e.g. `us-ashburn-1`). + /// + [Input("ociHomeRegion", required: true)] + public Input OciHomeRegion { get; set; } = null!; + + /// + /// OCI region for the linkage (ignored on create, applied on update). + /// + [Input("ociRegion")] + public Input? OciRegion { get; set; } + + /// + /// Service user name associated with the WIF configuration. + /// + [Input("ociSvcUserName", required: true)] + public Input OciSvcUserName { get; set; } = null!; + + /// + /// OCI tenancy OCID (root tenancy). Changing forces a new linked account. + /// + [Input("tenantId", required: true)] + public Input TenantId { get; set; } = null!; + + /// + /// Vault secret OCID containing a user or auxiliary secret. + /// + [Input("userVaultOcid")] + public Input? UserVaultOcid { get; set; } + + public OciLinkAccountArgs() + { + } + public static new OciLinkAccountArgs Empty => new OciLinkAccountArgs(); + } + + public sealed class OciLinkAccountState : global::Pulumi.ResourceArgs + { + /// + /// New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + /// + [Input("accountId")] + public Input? AccountId { get; set; } + + /// + /// OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + /// + [Input("compartmentOcid")] + public Input? CompartmentOcid { get; set; } + + /// + /// Vault secret OCID containing an ingest secret. + /// + [Input("ingestVaultOcid")] + public Input? IngestVaultOcid { get; set; } + + /// + /// Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + /// + [Input("instrumentationType")] + public Input? InstrumentationType { get; set; } + + /// + /// The Logging stack identifier for the OCI account. + /// + [Input("loggingStackOcid")] + public Input? LoggingStackOcid { get; set; } + + /// + /// Metric stack OCID (ignored on create, applied on update). + /// + [Input("metricStackOcid")] + public Input? MetricStackOcid { get; set; } + + /// + /// Display name for the linked account. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + /// + [Input("ociClientId")] + public Input? OciClientId { get; set; } + + [Input("ociClientSecret")] + private Input? _ociClientSecret; + + /// + /// OAuth2 client secret. Not displayed in plans or state outputs. + /// + public Input? OciClientSecret + { + get => _ociClientSecret; + set + { + var emptySecret = Output.CreateSecret(0); + _ociClientSecret = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + /// + [Input("ociDomainUrl")] + public Input? OciDomainUrl { get; set; } + + /// + /// Home region of the tenancy (e.g. `us-ashburn-1`). + /// + [Input("ociHomeRegion")] + public Input? OciHomeRegion { get; set; } + + /// + /// OCI region for the linkage (ignored on create, applied on update). + /// + [Input("ociRegion")] + public Input? OciRegion { get; set; } + + /// + /// Service user name associated with the WIF configuration. + /// + [Input("ociSvcUserName")] + public Input? OciSvcUserName { get; set; } + + /// + /// OCI tenancy OCID (root tenancy). Changing forces a new linked account. + /// + [Input("tenantId")] + public Input? TenantId { get; set; } + + /// + /// Vault secret OCID containing a user or auxiliary secret. + /// + [Input("userVaultOcid")] + public Input? UserVaultOcid { get; set; } + + public OciLinkAccountState() + { + } + public static new OciLinkAccountState Empty => new OciLinkAccountState(); + } +} diff --git a/sdk/go/newrelic/cloud/init.go b/sdk/go/newrelic/cloud/init.go index d313c9d3..cb8b315f 100644 --- a/sdk/go/newrelic/cloud/init.go +++ b/sdk/go/newrelic/cloud/init.go @@ -37,6 +37,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &GcpIntegrations{} case "newrelic:cloud/gcpLinkAccount:GcpLinkAccount": r = &GcpLinkAccount{} + case "newrelic:cloud/ociLinkAccount:OciLinkAccount": + r = &OciLinkAccount{} default: return nil, fmt.Errorf("unknown resource type: %s", typ) } @@ -90,4 +92,9 @@ func init() { "cloud/gcpLinkAccount", &module{version}, ) + pulumi.RegisterResourceModule( + "newrelic", + "cloud/ociLinkAccount", + &module{version}, + ) } diff --git a/sdk/go/newrelic/cloud/ociLinkAccount.go b/sdk/go/newrelic/cloud/ociLinkAccount.go new file mode 100644 index 00000000..1d49b9bb --- /dev/null +++ b/sdk/go/newrelic/cloud/ociLinkAccount.go @@ -0,0 +1,567 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package cloud + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. +// +// This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. +// +// ## Prerequisites +// +// For the `cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. +// +// > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\ +// See Getting Started: New Relic provider guide +// +// If you encounter issues or bugs, please open an issue in the GitHub repository. +// +// ### Workload Identity Federation (WIF) Attributes +// +// The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `ociClientId`, `ociClientSecret`, `ociDomainUrl`, and `ociSvcUserName`. +// +// To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: +// +// [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) +// +// WIF configuration steps: +// 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. +// 2. Generate / record the client ID (`ociClientId`) and client secret (`ociClientSecret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingestVaultOcid` / `userVaultOcid` if desired). +// 3. Use the Identity Domain base URL as `ociDomainUrl` (format: `https://idcs-.identity.oraclecloud.com`). +// 4. Provide / map a service user (or principal) used for workload identity federation as `ociSvcUserName`. +// 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. +// +// > TIP: Rotating the OAuth2 client secret only requires updating `ociClientSecret`; it does not force resource replacement. +// +// ## Example Usage +// +// Minimal example (required arguments for creation): +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/cloud" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cloud.NewOciLinkAccount(ctx, "example", &cloud.OciLinkAccountArgs{ +// AccountId: pulumi.String("1234567"), +// TenantId: pulumi.String("ocid1.tenancy.oc1..aaaaaaaaexample"), +// Name: pulumi.String("my-oci-link"), +// CompartmentOcid: pulumi.String("ocid1.compartment.oc1..bbbbbbbbexample"), +// OciClientId: pulumi.String("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), +// OciClientSecret: pulumi.Any(ociClientSecret), +// OciDomainUrl: pulumi.String("https://idcs-1234567890abcdef.identity.oraclecloud.com"), +// OciHomeRegion: pulumi.String("us-ashburn-1"), +// OciSvcUserName: pulumi.String("svc-newrelic-collector"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// Example including optional secret references and update-only fields: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/cloud" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cloud.NewOciLinkAccount(ctx, "full", &cloud.OciLinkAccountArgs{ +// Name: pulumi.String("my-oci-link-full"), +// TenantId: pulumi.String("ocid1.tenancy.oc1..aaaaaaaaexample"), +// CompartmentOcid: pulumi.String("ocid1.compartment.oc1..bbbbbbbbexample"), +// OciClientId: pulumi.String("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), +// OciClientSecret: pulumi.Any(ociClientSecret), +// OciDomainUrl: pulumi.String("https://idcs-1234567890abcdef.identity.oraclecloud.com"), +// OciHomeRegion: pulumi.String("us-ashburn-1"), +// OciSvcUserName: pulumi.String("svc-newrelic-collector"), +// IngestVaultOcid: pulumi.String("ocid1.vaultsecret.oc1..ccccccccexample"), +// UserVaultOcid: pulumi.String("ocid1.vaultsecret.oc1..ddddddddexample"), +// InstrumentationType: pulumi.String("METRICS,LOGS"), +// OciRegion: pulumi.String("us-phoenix-1"), +// MetricStackOcid: pulumi.String("ocid1.stack.oc1..eeeeeeeeexample"), +// LoggingStackOcid: pulumi.String("ocid1.stack.oc1..ffffffloggingstack"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Linked OCI accounts can be imported using the `id`, e.g. +// +// bash +// +// ```sh +// $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo +// ``` +type OciLinkAccount struct { + pulumi.CustomResourceState + + // New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + AccountId pulumi.StringOutput `pulumi:"accountId"` + // OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + CompartmentOcid pulumi.StringOutput `pulumi:"compartmentOcid"` + // Vault secret OCID containing an ingest secret. + IngestVaultOcid pulumi.StringPtrOutput `pulumi:"ingestVaultOcid"` + // Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + InstrumentationType pulumi.StringPtrOutput `pulumi:"instrumentationType"` + // The Logging stack identifier for the OCI account. + LoggingStackOcid pulumi.StringPtrOutput `pulumi:"loggingStackOcid"` + // Metric stack OCID (ignored on create, applied on update). + MetricStackOcid pulumi.StringPtrOutput `pulumi:"metricStackOcid"` + // Display name for the linked account. + Name pulumi.StringOutput `pulumi:"name"` + // OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + OciClientId pulumi.StringOutput `pulumi:"ociClientId"` + // OAuth2 client secret. Not displayed in plans or state outputs. + OciClientSecret pulumi.StringOutput `pulumi:"ociClientSecret"` + // Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + OciDomainUrl pulumi.StringOutput `pulumi:"ociDomainUrl"` + // Home region of the tenancy (e.g. `us-ashburn-1`). + OciHomeRegion pulumi.StringOutput `pulumi:"ociHomeRegion"` + // OCI region for the linkage (ignored on create, applied on update). + OciRegion pulumi.StringPtrOutput `pulumi:"ociRegion"` + // Service user name associated with the WIF configuration. + OciSvcUserName pulumi.StringOutput `pulumi:"ociSvcUserName"` + // OCI tenancy OCID (root tenancy). Changing forces a new linked account. + TenantId pulumi.StringOutput `pulumi:"tenantId"` + // Vault secret OCID containing a user or auxiliary secret. + UserVaultOcid pulumi.StringPtrOutput `pulumi:"userVaultOcid"` +} + +// NewOciLinkAccount registers a new resource with the given unique name, arguments, and options. +func NewOciLinkAccount(ctx *pulumi.Context, + name string, args *OciLinkAccountArgs, opts ...pulumi.ResourceOption) (*OciLinkAccount, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.CompartmentOcid == nil { + return nil, errors.New("invalid value for required argument 'CompartmentOcid'") + } + if args.OciClientId == nil { + return nil, errors.New("invalid value for required argument 'OciClientId'") + } + if args.OciClientSecret == nil { + return nil, errors.New("invalid value for required argument 'OciClientSecret'") + } + if args.OciDomainUrl == nil { + return nil, errors.New("invalid value for required argument 'OciDomainUrl'") + } + if args.OciHomeRegion == nil { + return nil, errors.New("invalid value for required argument 'OciHomeRegion'") + } + if args.OciSvcUserName == nil { + return nil, errors.New("invalid value for required argument 'OciSvcUserName'") + } + if args.TenantId == nil { + return nil, errors.New("invalid value for required argument 'TenantId'") + } + if args.OciClientSecret != nil { + args.OciClientSecret = pulumi.ToSecret(args.OciClientSecret).(pulumi.StringInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "ociClientSecret", + }) + opts = append(opts, secrets) + opts = internal.PkgResourceDefaultOpts(opts) + var resource OciLinkAccount + err := ctx.RegisterResource("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetOciLinkAccount gets an existing OciLinkAccount resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetOciLinkAccount(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *OciLinkAccountState, opts ...pulumi.ResourceOption) (*OciLinkAccount, error) { + var resource OciLinkAccount + err := ctx.ReadResource("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering OciLinkAccount resources. +type ociLinkAccountState struct { + // New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + AccountId *string `pulumi:"accountId"` + // OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + CompartmentOcid *string `pulumi:"compartmentOcid"` + // Vault secret OCID containing an ingest secret. + IngestVaultOcid *string `pulumi:"ingestVaultOcid"` + // Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + InstrumentationType *string `pulumi:"instrumentationType"` + // The Logging stack identifier for the OCI account. + LoggingStackOcid *string `pulumi:"loggingStackOcid"` + // Metric stack OCID (ignored on create, applied on update). + MetricStackOcid *string `pulumi:"metricStackOcid"` + // Display name for the linked account. + Name *string `pulumi:"name"` + // OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + OciClientId *string `pulumi:"ociClientId"` + // OAuth2 client secret. Not displayed in plans or state outputs. + OciClientSecret *string `pulumi:"ociClientSecret"` + // Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + OciDomainUrl *string `pulumi:"ociDomainUrl"` + // Home region of the tenancy (e.g. `us-ashburn-1`). + OciHomeRegion *string `pulumi:"ociHomeRegion"` + // OCI region for the linkage (ignored on create, applied on update). + OciRegion *string `pulumi:"ociRegion"` + // Service user name associated with the WIF configuration. + OciSvcUserName *string `pulumi:"ociSvcUserName"` + // OCI tenancy OCID (root tenancy). Changing forces a new linked account. + TenantId *string `pulumi:"tenantId"` + // Vault secret OCID containing a user or auxiliary secret. + UserVaultOcid *string `pulumi:"userVaultOcid"` +} + +type OciLinkAccountState struct { + // New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + AccountId pulumi.StringPtrInput + // OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + CompartmentOcid pulumi.StringPtrInput + // Vault secret OCID containing an ingest secret. + IngestVaultOcid pulumi.StringPtrInput + // Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + InstrumentationType pulumi.StringPtrInput + // The Logging stack identifier for the OCI account. + LoggingStackOcid pulumi.StringPtrInput + // Metric stack OCID (ignored on create, applied on update). + MetricStackOcid pulumi.StringPtrInput + // Display name for the linked account. + Name pulumi.StringPtrInput + // OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + OciClientId pulumi.StringPtrInput + // OAuth2 client secret. Not displayed in plans or state outputs. + OciClientSecret pulumi.StringPtrInput + // Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + OciDomainUrl pulumi.StringPtrInput + // Home region of the tenancy (e.g. `us-ashburn-1`). + OciHomeRegion pulumi.StringPtrInput + // OCI region for the linkage (ignored on create, applied on update). + OciRegion pulumi.StringPtrInput + // Service user name associated with the WIF configuration. + OciSvcUserName pulumi.StringPtrInput + // OCI tenancy OCID (root tenancy). Changing forces a new linked account. + TenantId pulumi.StringPtrInput + // Vault secret OCID containing a user or auxiliary secret. + UserVaultOcid pulumi.StringPtrInput +} + +func (OciLinkAccountState) ElementType() reflect.Type { + return reflect.TypeOf((*ociLinkAccountState)(nil)).Elem() +} + +type ociLinkAccountArgs struct { + // New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + AccountId *string `pulumi:"accountId"` + // OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + CompartmentOcid string `pulumi:"compartmentOcid"` + // Vault secret OCID containing an ingest secret. + IngestVaultOcid *string `pulumi:"ingestVaultOcid"` + // Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + InstrumentationType *string `pulumi:"instrumentationType"` + // The Logging stack identifier for the OCI account. + LoggingStackOcid *string `pulumi:"loggingStackOcid"` + // Metric stack OCID (ignored on create, applied on update). + MetricStackOcid *string `pulumi:"metricStackOcid"` + // Display name for the linked account. + Name *string `pulumi:"name"` + // OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + OciClientId string `pulumi:"ociClientId"` + // OAuth2 client secret. Not displayed in plans or state outputs. + OciClientSecret string `pulumi:"ociClientSecret"` + // Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + OciDomainUrl string `pulumi:"ociDomainUrl"` + // Home region of the tenancy (e.g. `us-ashburn-1`). + OciHomeRegion string `pulumi:"ociHomeRegion"` + // OCI region for the linkage (ignored on create, applied on update). + OciRegion *string `pulumi:"ociRegion"` + // Service user name associated with the WIF configuration. + OciSvcUserName string `pulumi:"ociSvcUserName"` + // OCI tenancy OCID (root tenancy). Changing forces a new linked account. + TenantId string `pulumi:"tenantId"` + // Vault secret OCID containing a user or auxiliary secret. + UserVaultOcid *string `pulumi:"userVaultOcid"` +} + +// The set of arguments for constructing a OciLinkAccount resource. +type OciLinkAccountArgs struct { + // New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + AccountId pulumi.StringPtrInput + // OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + CompartmentOcid pulumi.StringInput + // Vault secret OCID containing an ingest secret. + IngestVaultOcid pulumi.StringPtrInput + // Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + InstrumentationType pulumi.StringPtrInput + // The Logging stack identifier for the OCI account. + LoggingStackOcid pulumi.StringPtrInput + // Metric stack OCID (ignored on create, applied on update). + MetricStackOcid pulumi.StringPtrInput + // Display name for the linked account. + Name pulumi.StringPtrInput + // OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + OciClientId pulumi.StringInput + // OAuth2 client secret. Not displayed in plans or state outputs. + OciClientSecret pulumi.StringInput + // Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + OciDomainUrl pulumi.StringInput + // Home region of the tenancy (e.g. `us-ashburn-1`). + OciHomeRegion pulumi.StringInput + // OCI region for the linkage (ignored on create, applied on update). + OciRegion pulumi.StringPtrInput + // Service user name associated with the WIF configuration. + OciSvcUserName pulumi.StringInput + // OCI tenancy OCID (root tenancy). Changing forces a new linked account. + TenantId pulumi.StringInput + // Vault secret OCID containing a user or auxiliary secret. + UserVaultOcid pulumi.StringPtrInput +} + +func (OciLinkAccountArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ociLinkAccountArgs)(nil)).Elem() +} + +type OciLinkAccountInput interface { + pulumi.Input + + ToOciLinkAccountOutput() OciLinkAccountOutput + ToOciLinkAccountOutputWithContext(ctx context.Context) OciLinkAccountOutput +} + +func (*OciLinkAccount) ElementType() reflect.Type { + return reflect.TypeOf((**OciLinkAccount)(nil)).Elem() +} + +func (i *OciLinkAccount) ToOciLinkAccountOutput() OciLinkAccountOutput { + return i.ToOciLinkAccountOutputWithContext(context.Background()) +} + +func (i *OciLinkAccount) ToOciLinkAccountOutputWithContext(ctx context.Context) OciLinkAccountOutput { + return pulumi.ToOutputWithContext(ctx, i).(OciLinkAccountOutput) +} + +// OciLinkAccountArrayInput is an input type that accepts OciLinkAccountArray and OciLinkAccountArrayOutput values. +// You can construct a concrete instance of `OciLinkAccountArrayInput` via: +// +// OciLinkAccountArray{ OciLinkAccountArgs{...} } +type OciLinkAccountArrayInput interface { + pulumi.Input + + ToOciLinkAccountArrayOutput() OciLinkAccountArrayOutput + ToOciLinkAccountArrayOutputWithContext(context.Context) OciLinkAccountArrayOutput +} + +type OciLinkAccountArray []OciLinkAccountInput + +func (OciLinkAccountArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OciLinkAccount)(nil)).Elem() +} + +func (i OciLinkAccountArray) ToOciLinkAccountArrayOutput() OciLinkAccountArrayOutput { + return i.ToOciLinkAccountArrayOutputWithContext(context.Background()) +} + +func (i OciLinkAccountArray) ToOciLinkAccountArrayOutputWithContext(ctx context.Context) OciLinkAccountArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(OciLinkAccountArrayOutput) +} + +// OciLinkAccountMapInput is an input type that accepts OciLinkAccountMap and OciLinkAccountMapOutput values. +// You can construct a concrete instance of `OciLinkAccountMapInput` via: +// +// OciLinkAccountMap{ "key": OciLinkAccountArgs{...} } +type OciLinkAccountMapInput interface { + pulumi.Input + + ToOciLinkAccountMapOutput() OciLinkAccountMapOutput + ToOciLinkAccountMapOutputWithContext(context.Context) OciLinkAccountMapOutput +} + +type OciLinkAccountMap map[string]OciLinkAccountInput + +func (OciLinkAccountMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OciLinkAccount)(nil)).Elem() +} + +func (i OciLinkAccountMap) ToOciLinkAccountMapOutput() OciLinkAccountMapOutput { + return i.ToOciLinkAccountMapOutputWithContext(context.Background()) +} + +func (i OciLinkAccountMap) ToOciLinkAccountMapOutputWithContext(ctx context.Context) OciLinkAccountMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(OciLinkAccountMapOutput) +} + +type OciLinkAccountOutput struct{ *pulumi.OutputState } + +func (OciLinkAccountOutput) ElementType() reflect.Type { + return reflect.TypeOf((**OciLinkAccount)(nil)).Elem() +} + +func (o OciLinkAccountOutput) ToOciLinkAccountOutput() OciLinkAccountOutput { + return o +} + +func (o OciLinkAccountOutput) ToOciLinkAccountOutputWithContext(ctx context.Context) OciLinkAccountOutput { + return o +} + +// New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. +func (o OciLinkAccountOutput) AccountId() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput) +} + +// OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. +func (o OciLinkAccountOutput) CompartmentOcid() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.CompartmentOcid }).(pulumi.StringOutput) +} + +// Vault secret OCID containing an ingest secret. +func (o OciLinkAccountOutput) IngestVaultOcid() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.IngestVaultOcid }).(pulumi.StringPtrOutput) +} + +// Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). +func (o OciLinkAccountOutput) InstrumentationType() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.InstrumentationType }).(pulumi.StringPtrOutput) +} + +// The Logging stack identifier for the OCI account. +func (o OciLinkAccountOutput) LoggingStackOcid() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.LoggingStackOcid }).(pulumi.StringPtrOutput) +} + +// Metric stack OCID (ignored on create, applied on update). +func (o OciLinkAccountOutput) MetricStackOcid() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.MetricStackOcid }).(pulumi.StringPtrOutput) +} + +// Display name for the linked account. +func (o OciLinkAccountOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. +func (o OciLinkAccountOutput) OciClientId() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.OciClientId }).(pulumi.StringOutput) +} + +// OAuth2 client secret. Not displayed in plans or state outputs. +func (o OciLinkAccountOutput) OciClientSecret() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.OciClientSecret }).(pulumi.StringOutput) +} + +// Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). +func (o OciLinkAccountOutput) OciDomainUrl() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.OciDomainUrl }).(pulumi.StringOutput) +} + +// Home region of the tenancy (e.g. `us-ashburn-1`). +func (o OciLinkAccountOutput) OciHomeRegion() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.OciHomeRegion }).(pulumi.StringOutput) +} + +// OCI region for the linkage (ignored on create, applied on update). +func (o OciLinkAccountOutput) OciRegion() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.OciRegion }).(pulumi.StringPtrOutput) +} + +// Service user name associated with the WIF configuration. +func (o OciLinkAccountOutput) OciSvcUserName() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.OciSvcUserName }).(pulumi.StringOutput) +} + +// OCI tenancy OCID (root tenancy). Changing forces a new linked account. +func (o OciLinkAccountOutput) TenantId() pulumi.StringOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringOutput { return v.TenantId }).(pulumi.StringOutput) +} + +// Vault secret OCID containing a user or auxiliary secret. +func (o OciLinkAccountOutput) UserVaultOcid() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OciLinkAccount) pulumi.StringPtrOutput { return v.UserVaultOcid }).(pulumi.StringPtrOutput) +} + +type OciLinkAccountArrayOutput struct{ *pulumi.OutputState } + +func (OciLinkAccountArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OciLinkAccount)(nil)).Elem() +} + +func (o OciLinkAccountArrayOutput) ToOciLinkAccountArrayOutput() OciLinkAccountArrayOutput { + return o +} + +func (o OciLinkAccountArrayOutput) ToOciLinkAccountArrayOutputWithContext(ctx context.Context) OciLinkAccountArrayOutput { + return o +} + +func (o OciLinkAccountArrayOutput) Index(i pulumi.IntInput) OciLinkAccountOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OciLinkAccount { + return vs[0].([]*OciLinkAccount)[vs[1].(int)] + }).(OciLinkAccountOutput) +} + +type OciLinkAccountMapOutput struct{ *pulumi.OutputState } + +func (OciLinkAccountMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OciLinkAccount)(nil)).Elem() +} + +func (o OciLinkAccountMapOutput) ToOciLinkAccountMapOutput() OciLinkAccountMapOutput { + return o +} + +func (o OciLinkAccountMapOutput) ToOciLinkAccountMapOutputWithContext(ctx context.Context) OciLinkAccountMapOutput { + return o +} + +func (o OciLinkAccountMapOutput) MapIndex(k pulumi.StringInput) OciLinkAccountOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OciLinkAccount { + return vs[0].(map[string]*OciLinkAccount)[vs[1].(string)] + }).(OciLinkAccountOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*OciLinkAccountInput)(nil)).Elem(), &OciLinkAccount{}) + pulumi.RegisterInputType(reflect.TypeOf((*OciLinkAccountArrayInput)(nil)).Elem(), OciLinkAccountArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*OciLinkAccountMapInput)(nil)).Elem(), OciLinkAccountMap{}) + pulumi.RegisterOutputType(OciLinkAccountOutput{}) + pulumi.RegisterOutputType(OciLinkAccountArrayOutput{}) + pulumi.RegisterOutputType(OciLinkAccountMapOutput{}) +} diff --git a/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccount.java b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccount.java new file mode 100644 index 00000000..31a0b0b4 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccount.java @@ -0,0 +1,420 @@ +// *** WARNING: this file was generated by pulumi-language-java. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.newrelic.cloud; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import com.pulumi.newrelic.Utilities; +import com.pulumi.newrelic.cloud.OciLinkAccountArgs; +import com.pulumi.newrelic.cloud.inputs.OciLinkAccountState; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. + * + * This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. + * + * ## Prerequisites + * + * For the `newrelic.cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. + * + * > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\ + * See Getting Started: New Relic provider guide + * + * If you encounter issues or bugs, please open an issue in the GitHub repository. + * + * ### Workload Identity Federation (WIF) Attributes + * + * The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `oci_client_id`, `oci_client_secret`, `oci_domain_url`, and `oci_svc_user_name`. + * + * To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: + * + * [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) + * + * WIF configuration steps: + * 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. + * 2. Generate / record the client ID (`oci_client_id`) and client secret (`oci_client_secret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingest_vault_ocid` / `user_vault_ocid` if desired). + * 3. Use the Identity Domain base URL as `oci_domain_url` (format: `https://idcs-<hash>.identity.oraclecloud.com`). + * 4. Provide / map a service user (or principal) used for workload identity federation as `oci_svc_user_name`. + * 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. + * + * > TIP: Rotating the OAuth2 client secret only requires updating `oci_client_secret`; it does not force resource replacement. + * + * ## Example Usage + * + * Minimal example (required arguments for creation): + * + *
+ * {@code
+ * package generated_program;
+ * 
+ * import com.pulumi.Context;
+ * import com.pulumi.Pulumi;
+ * import com.pulumi.core.Output;
+ * import com.pulumi.newrelic.cloud.OciLinkAccount;
+ * import com.pulumi.newrelic.cloud.OciLinkAccountArgs;
+ * 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 OciLinkAccount("example", OciLinkAccountArgs.builder()
+ *             .accountId("1234567")
+ *             .tenantId("ocid1.tenancy.oc1..aaaaaaaaexample")
+ *             .name("my-oci-link")
+ *             .compartmentOcid("ocid1.compartment.oc1..bbbbbbbbexample")
+ *             .ociClientId("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
+ *             .ociClientSecret(ociClientSecret)
+ *             .ociDomainUrl("https://idcs-1234567890abcdef.identity.oraclecloud.com")
+ *             .ociHomeRegion("us-ashburn-1")
+ *             .ociSvcUserName("svc-newrelic-collector")
+ *             .build());
+ * 
+ *     }
+ * }
+ * }
+ * 
+ * + * Example including optional secret references and update-only fields: + * + *
+ * {@code
+ * package generated_program;
+ * 
+ * import com.pulumi.Context;
+ * import com.pulumi.Pulumi;
+ * import com.pulumi.core.Output;
+ * import com.pulumi.newrelic.cloud.OciLinkAccount;
+ * import com.pulumi.newrelic.cloud.OciLinkAccountArgs;
+ * 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 full = new OciLinkAccount("full", OciLinkAccountArgs.builder()
+ *             .name("my-oci-link-full")
+ *             .tenantId("ocid1.tenancy.oc1..aaaaaaaaexample")
+ *             .compartmentOcid("ocid1.compartment.oc1..bbbbbbbbexample")
+ *             .ociClientId("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
+ *             .ociClientSecret(ociClientSecret)
+ *             .ociDomainUrl("https://idcs-1234567890abcdef.identity.oraclecloud.com")
+ *             .ociHomeRegion("us-ashburn-1")
+ *             .ociSvcUserName("svc-newrelic-collector")
+ *             .ingestVaultOcid("ocid1.vaultsecret.oc1..ccccccccexample")
+ *             .userVaultOcid("ocid1.vaultsecret.oc1..ddddddddexample")
+ *             .instrumentationType("METRICS,LOGS")
+ *             .ociRegion("us-phoenix-1")
+ *             .metricStackOcid("ocid1.stack.oc1..eeeeeeeeexample")
+ *             .loggingStackOcid("ocid1.stack.oc1..ffffffloggingstack")
+ *             .build());
+ * 
+ *     }
+ * }
+ * }
+ * 
+ * + * ## Import + * + * Linked OCI accounts can be imported using the `id`, e.g. + * + * bash + * + * ```sh + * $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo <id> + * ``` + * + */ +@ResourceType(type="newrelic:cloud/ociLinkAccount:OciLinkAccount") +public class OciLinkAccount extends com.pulumi.resources.CustomResource { + /** + * New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + @Export(name="accountId", refs={String.class}, tree="[0]") + private Output accountId; + + /** + * @return New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + public Output accountId() { + return this.accountId; + } + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + @Export(name="compartmentOcid", refs={String.class}, tree="[0]") + private Output compartmentOcid; + + /** + * @return OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + public Output compartmentOcid() { + return this.compartmentOcid; + } + /** + * Vault secret OCID containing an ingest secret. + * + */ + @Export(name="ingestVaultOcid", refs={String.class}, tree="[0]") + private Output ingestVaultOcid; + + /** + * @return Vault secret OCID containing an ingest secret. + * + */ + public Output> ingestVaultOcid() { + return Codegen.optional(this.ingestVaultOcid); + } + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + @Export(name="instrumentationType", refs={String.class}, tree="[0]") + private Output instrumentationType; + + /** + * @return Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + public Output> instrumentationType() { + return Codegen.optional(this.instrumentationType); + } + /** + * The Logging stack identifier for the OCI account. + * + */ + @Export(name="loggingStackOcid", refs={String.class}, tree="[0]") + private Output loggingStackOcid; + + /** + * @return The Logging stack identifier for the OCI account. + * + */ + public Output> loggingStackOcid() { + return Codegen.optional(this.loggingStackOcid); + } + /** + * Metric stack OCID (ignored on create, applied on update). + * + */ + @Export(name="metricStackOcid", refs={String.class}, tree="[0]") + private Output metricStackOcid; + + /** + * @return Metric stack OCID (ignored on create, applied on update). + * + */ + public Output> metricStackOcid() { + return Codegen.optional(this.metricStackOcid); + } + /** + * Display name for the linked account. + * + */ + @Export(name="name", refs={String.class}, tree="[0]") + private Output name; + + /** + * @return Display name for the linked account. + * + */ + public Output name() { + return this.name; + } + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + @Export(name="ociClientId", refs={String.class}, tree="[0]") + private Output ociClientId; + + /** + * @return OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + public Output ociClientId() { + return this.ociClientId; + } + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + @Export(name="ociClientSecret", refs={String.class}, tree="[0]") + private Output ociClientSecret; + + /** + * @return OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + public Output ociClientSecret() { + return this.ociClientSecret; + } + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + @Export(name="ociDomainUrl", refs={String.class}, tree="[0]") + private Output ociDomainUrl; + + /** + * @return Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + public Output ociDomainUrl() { + return this.ociDomainUrl; + } + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + @Export(name="ociHomeRegion", refs={String.class}, tree="[0]") + private Output ociHomeRegion; + + /** + * @return Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + public Output ociHomeRegion() { + return this.ociHomeRegion; + } + /** + * OCI region for the linkage (ignored on create, applied on update). + * + */ + @Export(name="ociRegion", refs={String.class}, tree="[0]") + private Output ociRegion; + + /** + * @return OCI region for the linkage (ignored on create, applied on update). + * + */ + public Output> ociRegion() { + return Codegen.optional(this.ociRegion); + } + /** + * Service user name associated with the WIF configuration. + * + */ + @Export(name="ociSvcUserName", refs={String.class}, tree="[0]") + private Output ociSvcUserName; + + /** + * @return Service user name associated with the WIF configuration. + * + */ + public Output ociSvcUserName() { + return this.ociSvcUserName; + } + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + @Export(name="tenantId", refs={String.class}, tree="[0]") + private Output tenantId; + + /** + * @return OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + public Output tenantId() { + return this.tenantId; + } + /** + * Vault secret OCID containing a user or auxiliary secret. + * + */ + @Export(name="userVaultOcid", refs={String.class}, tree="[0]") + private Output userVaultOcid; + + /** + * @return Vault secret OCID containing a user or auxiliary secret. + * + */ + public Output> userVaultOcid() { + return Codegen.optional(this.userVaultOcid); + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public OciLinkAccount(java.lang.String name) { + this(name, OciLinkAccountArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public OciLinkAccount(java.lang.String name, OciLinkAccountArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public OciLinkAccount(java.lang.String name, OciLinkAccountArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); + } + + private OciLinkAccount(java.lang.String name, Output id, @Nullable OciLinkAccountState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("newrelic:cloud/ociLinkAccount:OciLinkAccount", name, state, makeResourceOptions(options, id), false); + } + + private static OciLinkAccountArgs makeArgs(OciLinkAccountArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + if (options != null && options.getUrn().isPresent()) { + return null; + } + return args == null ? OciLinkAccountArgs.Empty : args; + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "ociClientSecret" + )) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static OciLinkAccount get(java.lang.String name, Output id, @Nullable OciLinkAccountState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new OciLinkAccount(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccountArgs.java b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccountArgs.java new file mode 100644 index 00000000..e5150afa --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/OciLinkAccountArgs.java @@ -0,0 +1,623 @@ +// *** WARNING: this file was generated by pulumi-language-java. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.newrelic.cloud; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import com.pulumi.exceptions.MissingRequiredPropertyException; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class OciLinkAccountArgs extends com.pulumi.resources.ResourceArgs { + + public static final OciLinkAccountArgs Empty = new OciLinkAccountArgs(); + + /** + * New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + @Import(name="accountId") + private @Nullable Output accountId; + + /** + * @return New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + public Optional> accountId() { + return Optional.ofNullable(this.accountId); + } + + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + @Import(name="compartmentOcid", required=true) + private Output compartmentOcid; + + /** + * @return OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + public Output compartmentOcid() { + return this.compartmentOcid; + } + + /** + * Vault secret OCID containing an ingest secret. + * + */ + @Import(name="ingestVaultOcid") + private @Nullable Output ingestVaultOcid; + + /** + * @return Vault secret OCID containing an ingest secret. + * + */ + public Optional> ingestVaultOcid() { + return Optional.ofNullable(this.ingestVaultOcid); + } + + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + @Import(name="instrumentationType") + private @Nullable Output instrumentationType; + + /** + * @return Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + public Optional> instrumentationType() { + return Optional.ofNullable(this.instrumentationType); + } + + /** + * The Logging stack identifier for the OCI account. + * + */ + @Import(name="loggingStackOcid") + private @Nullable Output loggingStackOcid; + + /** + * @return The Logging stack identifier for the OCI account. + * + */ + public Optional> loggingStackOcid() { + return Optional.ofNullable(this.loggingStackOcid); + } + + /** + * Metric stack OCID (ignored on create, applied on update). + * + */ + @Import(name="metricStackOcid") + private @Nullable Output metricStackOcid; + + /** + * @return Metric stack OCID (ignored on create, applied on update). + * + */ + public Optional> metricStackOcid() { + return Optional.ofNullable(this.metricStackOcid); + } + + /** + * Display name for the linked account. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return Display name for the linked account. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + @Import(name="ociClientId", required=true) + private Output ociClientId; + + /** + * @return OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + public Output ociClientId() { + return this.ociClientId; + } + + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + @Import(name="ociClientSecret", required=true) + private Output ociClientSecret; + + /** + * @return OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + public Output ociClientSecret() { + return this.ociClientSecret; + } + + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + @Import(name="ociDomainUrl", required=true) + private Output ociDomainUrl; + + /** + * @return Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + public Output ociDomainUrl() { + return this.ociDomainUrl; + } + + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + @Import(name="ociHomeRegion", required=true) + private Output ociHomeRegion; + + /** + * @return Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + public Output ociHomeRegion() { + return this.ociHomeRegion; + } + + /** + * OCI region for the linkage (ignored on create, applied on update). + * + */ + @Import(name="ociRegion") + private @Nullable Output ociRegion; + + /** + * @return OCI region for the linkage (ignored on create, applied on update). + * + */ + public Optional> ociRegion() { + return Optional.ofNullable(this.ociRegion); + } + + /** + * Service user name associated with the WIF configuration. + * + */ + @Import(name="ociSvcUserName", required=true) + private Output ociSvcUserName; + + /** + * @return Service user name associated with the WIF configuration. + * + */ + public Output ociSvcUserName() { + return this.ociSvcUserName; + } + + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + @Import(name="tenantId", required=true) + private Output tenantId; + + /** + * @return OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + public Output tenantId() { + return this.tenantId; + } + + /** + * Vault secret OCID containing a user or auxiliary secret. + * + */ + @Import(name="userVaultOcid") + private @Nullable Output userVaultOcid; + + /** + * @return Vault secret OCID containing a user or auxiliary secret. + * + */ + public Optional> userVaultOcid() { + return Optional.ofNullable(this.userVaultOcid); + } + + private OciLinkAccountArgs() {} + + private OciLinkAccountArgs(OciLinkAccountArgs $) { + this.accountId = $.accountId; + this.compartmentOcid = $.compartmentOcid; + this.ingestVaultOcid = $.ingestVaultOcid; + this.instrumentationType = $.instrumentationType; + this.loggingStackOcid = $.loggingStackOcid; + this.metricStackOcid = $.metricStackOcid; + this.name = $.name; + this.ociClientId = $.ociClientId; + this.ociClientSecret = $.ociClientSecret; + this.ociDomainUrl = $.ociDomainUrl; + this.ociHomeRegion = $.ociHomeRegion; + this.ociRegion = $.ociRegion; + this.ociSvcUserName = $.ociSvcUserName; + this.tenantId = $.tenantId; + this.userVaultOcid = $.userVaultOcid; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OciLinkAccountArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OciLinkAccountArgs $; + + public Builder() { + $ = new OciLinkAccountArgs(); + } + + public Builder(OciLinkAccountArgs defaults) { + $ = new OciLinkAccountArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param accountId New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + * @return builder + * + */ + public Builder accountId(@Nullable Output accountId) { + $.accountId = accountId; + return this; + } + + /** + * @param accountId New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + * @return builder + * + */ + public Builder accountId(String accountId) { + return accountId(Output.of(accountId)); + } + + /** + * @param compartmentOcid OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + * @return builder + * + */ + public Builder compartmentOcid(Output compartmentOcid) { + $.compartmentOcid = compartmentOcid; + return this; + } + + /** + * @param compartmentOcid OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + * @return builder + * + */ + public Builder compartmentOcid(String compartmentOcid) { + return compartmentOcid(Output.of(compartmentOcid)); + } + + /** + * @param ingestVaultOcid Vault secret OCID containing an ingest secret. + * + * @return builder + * + */ + public Builder ingestVaultOcid(@Nullable Output ingestVaultOcid) { + $.ingestVaultOcid = ingestVaultOcid; + return this; + } + + /** + * @param ingestVaultOcid Vault secret OCID containing an ingest secret. + * + * @return builder + * + */ + public Builder ingestVaultOcid(String ingestVaultOcid) { + return ingestVaultOcid(Output.of(ingestVaultOcid)); + } + + /** + * @param instrumentationType Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + * @return builder + * + */ + public Builder instrumentationType(@Nullable Output instrumentationType) { + $.instrumentationType = instrumentationType; + return this; + } + + /** + * @param instrumentationType Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + * @return builder + * + */ + public Builder instrumentationType(String instrumentationType) { + return instrumentationType(Output.of(instrumentationType)); + } + + /** + * @param loggingStackOcid The Logging stack identifier for the OCI account. + * + * @return builder + * + */ + public Builder loggingStackOcid(@Nullable Output loggingStackOcid) { + $.loggingStackOcid = loggingStackOcid; + return this; + } + + /** + * @param loggingStackOcid The Logging stack identifier for the OCI account. + * + * @return builder + * + */ + public Builder loggingStackOcid(String loggingStackOcid) { + return loggingStackOcid(Output.of(loggingStackOcid)); + } + + /** + * @param metricStackOcid Metric stack OCID (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder metricStackOcid(@Nullable Output metricStackOcid) { + $.metricStackOcid = metricStackOcid; + return this; + } + + /** + * @param metricStackOcid Metric stack OCID (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder metricStackOcid(String metricStackOcid) { + return metricStackOcid(Output.of(metricStackOcid)); + } + + /** + * @param name Display name for the linked account. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name Display name for the linked account. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param ociClientId OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + * @return builder + * + */ + public Builder ociClientId(Output ociClientId) { + $.ociClientId = ociClientId; + return this; + } + + /** + * @param ociClientId OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + * @return builder + * + */ + public Builder ociClientId(String ociClientId) { + return ociClientId(Output.of(ociClientId)); + } + + /** + * @param ociClientSecret OAuth2 client secret. Not displayed in plans or state outputs. + * + * @return builder + * + */ + public Builder ociClientSecret(Output ociClientSecret) { + $.ociClientSecret = ociClientSecret; + return this; + } + + /** + * @param ociClientSecret OAuth2 client secret. Not displayed in plans or state outputs. + * + * @return builder + * + */ + public Builder ociClientSecret(String ociClientSecret) { + return ociClientSecret(Output.of(ociClientSecret)); + } + + /** + * @param ociDomainUrl Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + * @return builder + * + */ + public Builder ociDomainUrl(Output ociDomainUrl) { + $.ociDomainUrl = ociDomainUrl; + return this; + } + + /** + * @param ociDomainUrl Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + * @return builder + * + */ + public Builder ociDomainUrl(String ociDomainUrl) { + return ociDomainUrl(Output.of(ociDomainUrl)); + } + + /** + * @param ociHomeRegion Home region of the tenancy (e.g. `us-ashburn-1`). + * + * @return builder + * + */ + public Builder ociHomeRegion(Output ociHomeRegion) { + $.ociHomeRegion = ociHomeRegion; + return this; + } + + /** + * @param ociHomeRegion Home region of the tenancy (e.g. `us-ashburn-1`). + * + * @return builder + * + */ + public Builder ociHomeRegion(String ociHomeRegion) { + return ociHomeRegion(Output.of(ociHomeRegion)); + } + + /** + * @param ociRegion OCI region for the linkage (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder ociRegion(@Nullable Output ociRegion) { + $.ociRegion = ociRegion; + return this; + } + + /** + * @param ociRegion OCI region for the linkage (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder ociRegion(String ociRegion) { + return ociRegion(Output.of(ociRegion)); + } + + /** + * @param ociSvcUserName Service user name associated with the WIF configuration. + * + * @return builder + * + */ + public Builder ociSvcUserName(Output ociSvcUserName) { + $.ociSvcUserName = ociSvcUserName; + return this; + } + + /** + * @param ociSvcUserName Service user name associated with the WIF configuration. + * + * @return builder + * + */ + public Builder ociSvcUserName(String ociSvcUserName) { + return ociSvcUserName(Output.of(ociSvcUserName)); + } + + /** + * @param tenantId OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + * @return builder + * + */ + public Builder tenantId(Output tenantId) { + $.tenantId = tenantId; + return this; + } + + /** + * @param tenantId OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + * @return builder + * + */ + public Builder tenantId(String tenantId) { + return tenantId(Output.of(tenantId)); + } + + /** + * @param userVaultOcid Vault secret OCID containing a user or auxiliary secret. + * + * @return builder + * + */ + public Builder userVaultOcid(@Nullable Output userVaultOcid) { + $.userVaultOcid = userVaultOcid; + return this; + } + + /** + * @param userVaultOcid Vault secret OCID containing a user or auxiliary secret. + * + * @return builder + * + */ + public Builder userVaultOcid(String userVaultOcid) { + return userVaultOcid(Output.of(userVaultOcid)); + } + + public OciLinkAccountArgs build() { + if ($.compartmentOcid == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "compartmentOcid"); + } + if ($.ociClientId == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "ociClientId"); + } + if ($.ociClientSecret == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "ociClientSecret"); + } + if ($.ociDomainUrl == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "ociDomainUrl"); + } + if ($.ociHomeRegion == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "ociHomeRegion"); + } + if ($.ociSvcUserName == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "ociSvcUserName"); + } + if ($.tenantId == null) { + throw new MissingRequiredPropertyException("OciLinkAccountArgs", "tenantId"); + } + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/newrelic/cloud/inputs/OciLinkAccountState.java b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/inputs/OciLinkAccountState.java new file mode 100644 index 00000000..e769db2e --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/newrelic/cloud/inputs/OciLinkAccountState.java @@ -0,0 +1,601 @@ +// *** WARNING: this file was generated by pulumi-language-java. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.newrelic.cloud.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class OciLinkAccountState extends com.pulumi.resources.ResourceArgs { + + public static final OciLinkAccountState Empty = new OciLinkAccountState(); + + /** + * New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + @Import(name="accountId") + private @Nullable Output accountId; + + /** + * @return New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + */ + public Optional> accountId() { + return Optional.ofNullable(this.accountId); + } + + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + @Import(name="compartmentOcid") + private @Nullable Output compartmentOcid; + + /** + * @return OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + */ + public Optional> compartmentOcid() { + return Optional.ofNullable(this.compartmentOcid); + } + + /** + * Vault secret OCID containing an ingest secret. + * + */ + @Import(name="ingestVaultOcid") + private @Nullable Output ingestVaultOcid; + + /** + * @return Vault secret OCID containing an ingest secret. + * + */ + public Optional> ingestVaultOcid() { + return Optional.ofNullable(this.ingestVaultOcid); + } + + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + @Import(name="instrumentationType") + private @Nullable Output instrumentationType; + + /** + * @return Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + */ + public Optional> instrumentationType() { + return Optional.ofNullable(this.instrumentationType); + } + + /** + * The Logging stack identifier for the OCI account. + * + */ + @Import(name="loggingStackOcid") + private @Nullable Output loggingStackOcid; + + /** + * @return The Logging stack identifier for the OCI account. + * + */ + public Optional> loggingStackOcid() { + return Optional.ofNullable(this.loggingStackOcid); + } + + /** + * Metric stack OCID (ignored on create, applied on update). + * + */ + @Import(name="metricStackOcid") + private @Nullable Output metricStackOcid; + + /** + * @return Metric stack OCID (ignored on create, applied on update). + * + */ + public Optional> metricStackOcid() { + return Optional.ofNullable(this.metricStackOcid); + } + + /** + * Display name for the linked account. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return Display name for the linked account. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + @Import(name="ociClientId") + private @Nullable Output ociClientId; + + /** + * @return OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + */ + public Optional> ociClientId() { + return Optional.ofNullable(this.ociClientId); + } + + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + @Import(name="ociClientSecret") + private @Nullable Output ociClientSecret; + + /** + * @return OAuth2 client secret. Not displayed in plans or state outputs. + * + */ + public Optional> ociClientSecret() { + return Optional.ofNullable(this.ociClientSecret); + } + + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + @Import(name="ociDomainUrl") + private @Nullable Output ociDomainUrl; + + /** + * @return Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + */ + public Optional> ociDomainUrl() { + return Optional.ofNullable(this.ociDomainUrl); + } + + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + @Import(name="ociHomeRegion") + private @Nullable Output ociHomeRegion; + + /** + * @return Home region of the tenancy (e.g. `us-ashburn-1`). + * + */ + public Optional> ociHomeRegion() { + return Optional.ofNullable(this.ociHomeRegion); + } + + /** + * OCI region for the linkage (ignored on create, applied on update). + * + */ + @Import(name="ociRegion") + private @Nullable Output ociRegion; + + /** + * @return OCI region for the linkage (ignored on create, applied on update). + * + */ + public Optional> ociRegion() { + return Optional.ofNullable(this.ociRegion); + } + + /** + * Service user name associated with the WIF configuration. + * + */ + @Import(name="ociSvcUserName") + private @Nullable Output ociSvcUserName; + + /** + * @return Service user name associated with the WIF configuration. + * + */ + public Optional> ociSvcUserName() { + return Optional.ofNullable(this.ociSvcUserName); + } + + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + @Import(name="tenantId") + private @Nullable Output tenantId; + + /** + * @return OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + */ + public Optional> tenantId() { + return Optional.ofNullable(this.tenantId); + } + + /** + * Vault secret OCID containing a user or auxiliary secret. + * + */ + @Import(name="userVaultOcid") + private @Nullable Output userVaultOcid; + + /** + * @return Vault secret OCID containing a user or auxiliary secret. + * + */ + public Optional> userVaultOcid() { + return Optional.ofNullable(this.userVaultOcid); + } + + private OciLinkAccountState() {} + + private OciLinkAccountState(OciLinkAccountState $) { + this.accountId = $.accountId; + this.compartmentOcid = $.compartmentOcid; + this.ingestVaultOcid = $.ingestVaultOcid; + this.instrumentationType = $.instrumentationType; + this.loggingStackOcid = $.loggingStackOcid; + this.metricStackOcid = $.metricStackOcid; + this.name = $.name; + this.ociClientId = $.ociClientId; + this.ociClientSecret = $.ociClientSecret; + this.ociDomainUrl = $.ociDomainUrl; + this.ociHomeRegion = $.ociHomeRegion; + this.ociRegion = $.ociRegion; + this.ociSvcUserName = $.ociSvcUserName; + this.tenantId = $.tenantId; + this.userVaultOcid = $.userVaultOcid; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OciLinkAccountState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OciLinkAccountState $; + + public Builder() { + $ = new OciLinkAccountState(); + } + + public Builder(OciLinkAccountState defaults) { + $ = new OciLinkAccountState(Objects.requireNonNull(defaults)); + } + + /** + * @param accountId New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + * @return builder + * + */ + public Builder accountId(@Nullable Output accountId) { + $.accountId = accountId; + return this; + } + + /** + * @param accountId New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + * + * @return builder + * + */ + public Builder accountId(String accountId) { + return accountId(Output.of(accountId)); + } + + /** + * @param compartmentOcid OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + * @return builder + * + */ + public Builder compartmentOcid(@Nullable Output compartmentOcid) { + $.compartmentOcid = compartmentOcid; + return this; + } + + /** + * @param compartmentOcid OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + * + * @return builder + * + */ + public Builder compartmentOcid(String compartmentOcid) { + return compartmentOcid(Output.of(compartmentOcid)); + } + + /** + * @param ingestVaultOcid Vault secret OCID containing an ingest secret. + * + * @return builder + * + */ + public Builder ingestVaultOcid(@Nullable Output ingestVaultOcid) { + $.ingestVaultOcid = ingestVaultOcid; + return this; + } + + /** + * @param ingestVaultOcid Vault secret OCID containing an ingest secret. + * + * @return builder + * + */ + public Builder ingestVaultOcid(String ingestVaultOcid) { + return ingestVaultOcid(Output.of(ingestVaultOcid)); + } + + /** + * @param instrumentationType Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + * @return builder + * + */ + public Builder instrumentationType(@Nullable Output instrumentationType) { + $.instrumentationType = instrumentationType; + return this; + } + + /** + * @param instrumentationType Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + * + * @return builder + * + */ + public Builder instrumentationType(String instrumentationType) { + return instrumentationType(Output.of(instrumentationType)); + } + + /** + * @param loggingStackOcid The Logging stack identifier for the OCI account. + * + * @return builder + * + */ + public Builder loggingStackOcid(@Nullable Output loggingStackOcid) { + $.loggingStackOcid = loggingStackOcid; + return this; + } + + /** + * @param loggingStackOcid The Logging stack identifier for the OCI account. + * + * @return builder + * + */ + public Builder loggingStackOcid(String loggingStackOcid) { + return loggingStackOcid(Output.of(loggingStackOcid)); + } + + /** + * @param metricStackOcid Metric stack OCID (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder metricStackOcid(@Nullable Output metricStackOcid) { + $.metricStackOcid = metricStackOcid; + return this; + } + + /** + * @param metricStackOcid Metric stack OCID (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder metricStackOcid(String metricStackOcid) { + return metricStackOcid(Output.of(metricStackOcid)); + } + + /** + * @param name Display name for the linked account. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name Display name for the linked account. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param ociClientId OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + * @return builder + * + */ + public Builder ociClientId(@Nullable Output ociClientId) { + $.ociClientId = ociClientId; + return this; + } + + /** + * @param ociClientId OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + * + * @return builder + * + */ + public Builder ociClientId(String ociClientId) { + return ociClientId(Output.of(ociClientId)); + } + + /** + * @param ociClientSecret OAuth2 client secret. Not displayed in plans or state outputs. + * + * @return builder + * + */ + public Builder ociClientSecret(@Nullable Output ociClientSecret) { + $.ociClientSecret = ociClientSecret; + return this; + } + + /** + * @param ociClientSecret OAuth2 client secret. Not displayed in plans or state outputs. + * + * @return builder + * + */ + public Builder ociClientSecret(String ociClientSecret) { + return ociClientSecret(Output.of(ociClientSecret)); + } + + /** + * @param ociDomainUrl Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + * @return builder + * + */ + public Builder ociDomainUrl(@Nullable Output ociDomainUrl) { + $.ociDomainUrl = ociDomainUrl; + return this; + } + + /** + * @param ociDomainUrl Base URL of the OCI Identity Domain (e.g. `https://idcs-<hash>.identity.oraclecloud.com`). + * + * @return builder + * + */ + public Builder ociDomainUrl(String ociDomainUrl) { + return ociDomainUrl(Output.of(ociDomainUrl)); + } + + /** + * @param ociHomeRegion Home region of the tenancy (e.g. `us-ashburn-1`). + * + * @return builder + * + */ + public Builder ociHomeRegion(@Nullable Output ociHomeRegion) { + $.ociHomeRegion = ociHomeRegion; + return this; + } + + /** + * @param ociHomeRegion Home region of the tenancy (e.g. `us-ashburn-1`). + * + * @return builder + * + */ + public Builder ociHomeRegion(String ociHomeRegion) { + return ociHomeRegion(Output.of(ociHomeRegion)); + } + + /** + * @param ociRegion OCI region for the linkage (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder ociRegion(@Nullable Output ociRegion) { + $.ociRegion = ociRegion; + return this; + } + + /** + * @param ociRegion OCI region for the linkage (ignored on create, applied on update). + * + * @return builder + * + */ + public Builder ociRegion(String ociRegion) { + return ociRegion(Output.of(ociRegion)); + } + + /** + * @param ociSvcUserName Service user name associated with the WIF configuration. + * + * @return builder + * + */ + public Builder ociSvcUserName(@Nullable Output ociSvcUserName) { + $.ociSvcUserName = ociSvcUserName; + return this; + } + + /** + * @param ociSvcUserName Service user name associated with the WIF configuration. + * + * @return builder + * + */ + public Builder ociSvcUserName(String ociSvcUserName) { + return ociSvcUserName(Output.of(ociSvcUserName)); + } + + /** + * @param tenantId OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + * @return builder + * + */ + public Builder tenantId(@Nullable Output tenantId) { + $.tenantId = tenantId; + return this; + } + + /** + * @param tenantId OCI tenancy OCID (root tenancy). Changing forces a new linked account. + * + * @return builder + * + */ + public Builder tenantId(String tenantId) { + return tenantId(Output.of(tenantId)); + } + + /** + * @param userVaultOcid Vault secret OCID containing a user or auxiliary secret. + * + * @return builder + * + */ + public Builder userVaultOcid(@Nullable Output userVaultOcid) { + $.userVaultOcid = userVaultOcid; + return this; + } + + /** + * @param userVaultOcid Vault secret OCID containing a user or auxiliary secret. + * + * @return builder + * + */ + public Builder userVaultOcid(String userVaultOcid) { + return userVaultOcid(Output.of(userVaultOcid)); + } + + public OciLinkAccountState build() { + return $; + } + } + +} diff --git a/sdk/nodejs/cloud/index.ts b/sdk/nodejs/cloud/index.ts index 30748c3f..b9026afc 100644 --- a/sdk/nodejs/cloud/index.ts +++ b/sdk/nodejs/cloud/index.ts @@ -45,6 +45,11 @@ export type GcpLinkAccount = import("./gcpLinkAccount").GcpLinkAccount; export const GcpLinkAccount: typeof import("./gcpLinkAccount").GcpLinkAccount = null as any; utilities.lazyLoad(exports, ["GcpLinkAccount"], () => require("./gcpLinkAccount")); +export { OciLinkAccountArgs, OciLinkAccountState } from "./ociLinkAccount"; +export type OciLinkAccount = import("./ociLinkAccount").OciLinkAccount; +export const OciLinkAccount: typeof import("./ociLinkAccount").OciLinkAccount = null as any; +utilities.lazyLoad(exports, ["OciLinkAccount"], () => require("./ociLinkAccount")); + const _module = { version: utilities.getVersion(), @@ -66,6 +71,8 @@ const _module = { return new GcpIntegrations(name, undefined, { urn }) case "newrelic:cloud/gcpLinkAccount:GcpLinkAccount": return new GcpLinkAccount(name, undefined, { urn }) + case "newrelic:cloud/ociLinkAccount:OciLinkAccount": + return new OciLinkAccount(name, undefined, { urn }) default: throw new Error(`unknown resource type ${type}`); } @@ -79,3 +86,4 @@ pulumi.runtime.registerResourceModule("newrelic", "cloud/azureIntegrations", _mo pulumi.runtime.registerResourceModule("newrelic", "cloud/azureLinkAccount", _module) pulumi.runtime.registerResourceModule("newrelic", "cloud/gcpIntegrations", _module) pulumi.runtime.registerResourceModule("newrelic", "cloud/gcpLinkAccount", _module) +pulumi.runtime.registerResourceModule("newrelic", "cloud/ociLinkAccount", _module) diff --git a/sdk/nodejs/cloud/ociLinkAccount.ts b/sdk/nodejs/cloud/ociLinkAccount.ts new file mode 100644 index 00000000..413a4784 --- /dev/null +++ b/sdk/nodejs/cloud/ociLinkAccount.ts @@ -0,0 +1,386 @@ +// *** WARNING: this file was generated by pulumi-language-nodejs. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "../utilities"; + +/** + * Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. + * + * This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. + * + * ## Prerequisites + * + * For the `newrelic.cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. + * + * > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\ + * See Getting Started: New Relic provider guide + * + * If you encounter issues or bugs, please open an issue in the GitHub repository. + * + * ### Workload Identity Federation (WIF) Attributes + * + * The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `ociClientId`, `ociClientSecret`, `ociDomainUrl`, and `ociSvcUserName`. + * + * To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: + * + * [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) + * + * WIF configuration steps: + * 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. + * 2. Generate / record the client ID (`ociClientId`) and client secret (`ociClientSecret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingestVaultOcid` / `userVaultOcid` if desired). + * 3. Use the Identity Domain base URL as `ociDomainUrl` (format: `https://idcs-.identity.oraclecloud.com`). + * 4. Provide / map a service user (or principal) used for workload identity federation as `ociSvcUserName`. + * 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. + * + * > TIP: Rotating the OAuth2 client secret only requires updating `ociClientSecret`; it does not force resource replacement. + * + * ## Example Usage + * + * Minimal example (required arguments for creation): + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as newrelic from "@pulumi/newrelic"; + * + * const example = new newrelic.cloud.OciLinkAccount("example", { + * accountId: "1234567", + * tenantId: "ocid1.tenancy.oc1..aaaaaaaaexample", + * name: "my-oci-link", + * compartmentOcid: "ocid1.compartment.oc1..bbbbbbbbexample", + * ociClientId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + * ociClientSecret: ociClientSecret, + * ociDomainUrl: "https://idcs-1234567890abcdef.identity.oraclecloud.com", + * ociHomeRegion: "us-ashburn-1", + * ociSvcUserName: "svc-newrelic-collector", + * }); + * ``` + * + * Example including optional secret references and update-only fields: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as newrelic from "@pulumi/newrelic"; + * + * const full = new newrelic.cloud.OciLinkAccount("full", { + * name: "my-oci-link-full", + * tenantId: "ocid1.tenancy.oc1..aaaaaaaaexample", + * compartmentOcid: "ocid1.compartment.oc1..bbbbbbbbexample", + * ociClientId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + * ociClientSecret: ociClientSecret, + * ociDomainUrl: "https://idcs-1234567890abcdef.identity.oraclecloud.com", + * ociHomeRegion: "us-ashburn-1", + * ociSvcUserName: "svc-newrelic-collector", + * ingestVaultOcid: "ocid1.vaultsecret.oc1..ccccccccexample", + * userVaultOcid: "ocid1.vaultsecret.oc1..ddddddddexample", + * instrumentationType: "METRICS,LOGS", + * ociRegion: "us-phoenix-1", + * metricStackOcid: "ocid1.stack.oc1..eeeeeeeeexample", + * loggingStackOcid: "ocid1.stack.oc1..ffffffloggingstack", + * }); + * ``` + * + * ## Import + * + * Linked OCI accounts can be imported using the `id`, e.g. + * + * bash + * + * ```sh + * $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo + * ``` + */ +export class OciLinkAccount extends pulumi.CustomResource { + /** + * Get an existing OciLinkAccount resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: OciLinkAccountState, opts?: pulumi.CustomResourceOptions): OciLinkAccount { + return new OciLinkAccount(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'newrelic:cloud/ociLinkAccount:OciLinkAccount'; + + /** + * Returns true if the given object is an instance of OciLinkAccount. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is OciLinkAccount { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === OciLinkAccount.__pulumiType; + } + + /** + * New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + */ + declare public readonly accountId: pulumi.Output; + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + */ + declare public readonly compartmentOcid: pulumi.Output; + /** + * Vault secret OCID containing an ingest secret. + */ + declare public readonly ingestVaultOcid: pulumi.Output; + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + */ + declare public readonly instrumentationType: pulumi.Output; + /** + * The Logging stack identifier for the OCI account. + */ + declare public readonly loggingStackOcid: pulumi.Output; + /** + * Metric stack OCID (ignored on create, applied on update). + */ + declare public readonly metricStackOcid: pulumi.Output; + /** + * Display name for the linked account. + */ + declare public readonly name: pulumi.Output; + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + */ + declare public readonly ociClientId: pulumi.Output; + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + */ + declare public readonly ociClientSecret: pulumi.Output; + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + */ + declare public readonly ociDomainUrl: pulumi.Output; + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + */ + declare public readonly ociHomeRegion: pulumi.Output; + /** + * OCI region for the linkage (ignored on create, applied on update). + */ + declare public readonly ociRegion: pulumi.Output; + /** + * Service user name associated with the WIF configuration. + */ + declare public readonly ociSvcUserName: pulumi.Output; + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + */ + declare public readonly tenantId: pulumi.Output; + /** + * Vault secret OCID containing a user or auxiliary secret. + */ + declare public readonly userVaultOcid: pulumi.Output; + + /** + * Create a OciLinkAccount resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: OciLinkAccountArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: OciLinkAccountArgs | OciLinkAccountState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as OciLinkAccountState | undefined; + resourceInputs["accountId"] = state?.accountId; + resourceInputs["compartmentOcid"] = state?.compartmentOcid; + resourceInputs["ingestVaultOcid"] = state?.ingestVaultOcid; + resourceInputs["instrumentationType"] = state?.instrumentationType; + resourceInputs["loggingStackOcid"] = state?.loggingStackOcid; + resourceInputs["metricStackOcid"] = state?.metricStackOcid; + resourceInputs["name"] = state?.name; + resourceInputs["ociClientId"] = state?.ociClientId; + resourceInputs["ociClientSecret"] = state?.ociClientSecret; + resourceInputs["ociDomainUrl"] = state?.ociDomainUrl; + resourceInputs["ociHomeRegion"] = state?.ociHomeRegion; + resourceInputs["ociRegion"] = state?.ociRegion; + resourceInputs["ociSvcUserName"] = state?.ociSvcUserName; + resourceInputs["tenantId"] = state?.tenantId; + resourceInputs["userVaultOcid"] = state?.userVaultOcid; + } else { + const args = argsOrState as OciLinkAccountArgs | undefined; + if (args?.compartmentOcid === undefined && !opts.urn) { + throw new Error("Missing required property 'compartmentOcid'"); + } + if (args?.ociClientId === undefined && !opts.urn) { + throw new Error("Missing required property 'ociClientId'"); + } + if (args?.ociClientSecret === undefined && !opts.urn) { + throw new Error("Missing required property 'ociClientSecret'"); + } + if (args?.ociDomainUrl === undefined && !opts.urn) { + throw new Error("Missing required property 'ociDomainUrl'"); + } + if (args?.ociHomeRegion === undefined && !opts.urn) { + throw new Error("Missing required property 'ociHomeRegion'"); + } + if (args?.ociSvcUserName === undefined && !opts.urn) { + throw new Error("Missing required property 'ociSvcUserName'"); + } + if (args?.tenantId === undefined && !opts.urn) { + throw new Error("Missing required property 'tenantId'"); + } + resourceInputs["accountId"] = args?.accountId; + resourceInputs["compartmentOcid"] = args?.compartmentOcid; + resourceInputs["ingestVaultOcid"] = args?.ingestVaultOcid; + resourceInputs["instrumentationType"] = args?.instrumentationType; + resourceInputs["loggingStackOcid"] = args?.loggingStackOcid; + resourceInputs["metricStackOcid"] = args?.metricStackOcid; + resourceInputs["name"] = args?.name; + resourceInputs["ociClientId"] = args?.ociClientId; + resourceInputs["ociClientSecret"] = args?.ociClientSecret ? pulumi.secret(args.ociClientSecret) : undefined; + resourceInputs["ociDomainUrl"] = args?.ociDomainUrl; + resourceInputs["ociHomeRegion"] = args?.ociHomeRegion; + resourceInputs["ociRegion"] = args?.ociRegion; + resourceInputs["ociSvcUserName"] = args?.ociSvcUserName; + resourceInputs["tenantId"] = args?.tenantId; + resourceInputs["userVaultOcid"] = args?.userVaultOcid; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["ociClientSecret"] }; + opts = pulumi.mergeOptions(opts, secretOpts); + super(OciLinkAccount.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering OciLinkAccount resources. + */ +export interface OciLinkAccountState { + /** + * New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + */ + accountId?: pulumi.Input; + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + */ + compartmentOcid?: pulumi.Input; + /** + * Vault secret OCID containing an ingest secret. + */ + ingestVaultOcid?: pulumi.Input; + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + */ + instrumentationType?: pulumi.Input; + /** + * The Logging stack identifier for the OCI account. + */ + loggingStackOcid?: pulumi.Input; + /** + * Metric stack OCID (ignored on create, applied on update). + */ + metricStackOcid?: pulumi.Input; + /** + * Display name for the linked account. + */ + name?: pulumi.Input; + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + */ + ociClientId?: pulumi.Input; + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + */ + ociClientSecret?: pulumi.Input; + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + */ + ociDomainUrl?: pulumi.Input; + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + */ + ociHomeRegion?: pulumi.Input; + /** + * OCI region for the linkage (ignored on create, applied on update). + */ + ociRegion?: pulumi.Input; + /** + * Service user name associated with the WIF configuration. + */ + ociSvcUserName?: pulumi.Input; + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + */ + tenantId?: pulumi.Input; + /** + * Vault secret OCID containing a user or auxiliary secret. + */ + userVaultOcid?: pulumi.Input; +} + +/** + * The set of arguments for constructing a OciLinkAccount resource. + */ +export interface OciLinkAccountArgs { + /** + * New Relic account to operate on. Overrides the provider-level `accountId`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + */ + accountId?: pulumi.Input; + /** + * OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + */ + compartmentOcid: pulumi.Input; + /** + * Vault secret OCID containing an ingest secret. + */ + ingestVaultOcid?: pulumi.Input; + /** + * Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + */ + instrumentationType?: pulumi.Input; + /** + * The Logging stack identifier for the OCI account. + */ + loggingStackOcid?: pulumi.Input; + /** + * Metric stack OCID (ignored on create, applied on update). + */ + metricStackOcid?: pulumi.Input; + /** + * Display name for the linked account. + */ + name?: pulumi.Input; + /** + * OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + */ + ociClientId: pulumi.Input; + /** + * OAuth2 client secret. Not displayed in plans or state outputs. + */ + ociClientSecret: pulumi.Input; + /** + * Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + */ + ociDomainUrl: pulumi.Input; + /** + * Home region of the tenancy (e.g. `us-ashburn-1`). + */ + ociHomeRegion: pulumi.Input; + /** + * OCI region for the linkage (ignored on create, applied on update). + */ + ociRegion?: pulumi.Input; + /** + * Service user name associated with the WIF configuration. + */ + ociSvcUserName: pulumi.Input; + /** + * OCI tenancy OCID (root tenancy). Changing forces a new linked account. + */ + tenantId: pulumi.Input; + /** + * Vault secret OCID containing a user or auxiliary secret. + */ + userVaultOcid?: pulumi.Input; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 6850c61a..030a00ba 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -30,6 +30,7 @@ "cloud/gcpIntegrations.ts", "cloud/gcpLinkAccount.ts", "cloud/index.ts", + "cloud/ociLinkAccount.ts", "config/index.ts", "config/vars.ts", "dataPartitionRule.ts", diff --git a/sdk/python/pulumi_newrelic/__init__.py b/sdk/python/pulumi_newrelic/__init__.py index 19f323c7..2d86aa07 100644 --- a/sdk/python/pulumi_newrelic/__init__.py +++ b/sdk/python/pulumi_newrelic/__init__.py @@ -139,6 +139,14 @@ "newrelic:cloud/gcpLinkAccount:GcpLinkAccount": "GcpLinkAccount" } }, + { + "pkg": "newrelic", + "mod": "cloud/ociLinkAccount", + "fqn": "pulumi_newrelic.cloud", + "classes": { + "newrelic:cloud/ociLinkAccount:OciLinkAccount": "OciLinkAccount" + } + }, { "pkg": "newrelic", "mod": "index/accountManagement", diff --git a/sdk/python/pulumi_newrelic/cloud/__init__.py b/sdk/python/pulumi_newrelic/cloud/__init__.py index b76d3e2e..2c7b8975 100644 --- a/sdk/python/pulumi_newrelic/cloud/__init__.py +++ b/sdk/python/pulumi_newrelic/cloud/__init__.py @@ -14,5 +14,6 @@ from .azure_link_account import * from .gcp_integrations import * from .gcp_link_account import * +from .oci_link_account import * from ._inputs import * from . import outputs diff --git a/sdk/python/pulumi_newrelic/cloud/oci_link_account.py b/sdk/python/pulumi_newrelic/cloud/oci_link_account.py new file mode 100644 index 00000000..06f9a7cb --- /dev/null +++ b/sdk/python/pulumi_newrelic/cloud/oci_link_account.py @@ -0,0 +1,980 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-language-python. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import builtins as _builtins +import warnings +import sys +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +if sys.version_info >= (3, 11): + from typing import NotRequired, TypedDict, TypeAlias +else: + from typing_extensions import NotRequired, TypedDict, TypeAlias +from .. import _utilities + +__all__ = ['OciLinkAccountArgs', 'OciLinkAccount'] + +@pulumi.input_type +class OciLinkAccountArgs: + def __init__(__self__, *, + compartment_ocid: pulumi.Input[_builtins.str], + oci_client_id: pulumi.Input[_builtins.str], + oci_client_secret: pulumi.Input[_builtins.str], + oci_domain_url: pulumi.Input[_builtins.str], + oci_home_region: pulumi.Input[_builtins.str], + oci_svc_user_name: pulumi.Input[_builtins.str], + tenant_id: pulumi.Input[_builtins.str], + account_id: Optional[pulumi.Input[_builtins.str]] = None, + ingest_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + instrumentation_type: Optional[pulumi.Input[_builtins.str]] = None, + logging_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + metric_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + name: Optional[pulumi.Input[_builtins.str]] = None, + oci_region: Optional[pulumi.Input[_builtins.str]] = None, + user_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None): + """ + The set of arguments for constructing a OciLinkAccount resource. + :param pulumi.Input[_builtins.str] compartment_ocid: OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + :param pulumi.Input[_builtins.str] oci_client_id: OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + :param pulumi.Input[_builtins.str] oci_client_secret: OAuth2 client secret. Not displayed in plans or state outputs. + :param pulumi.Input[_builtins.str] oci_domain_url: Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + :param pulumi.Input[_builtins.str] oci_home_region: Home region of the tenancy (e.g. `us-ashburn-1`). + :param pulumi.Input[_builtins.str] oci_svc_user_name: Service user name associated with the WIF configuration. + :param pulumi.Input[_builtins.str] tenant_id: OCI tenancy OCID (root tenancy). Changing forces a new linked account. + :param pulumi.Input[_builtins.str] account_id: New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + :param pulumi.Input[_builtins.str] ingest_vault_ocid: Vault secret OCID containing an ingest secret. + :param pulumi.Input[_builtins.str] instrumentation_type: Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + :param pulumi.Input[_builtins.str] logging_stack_ocid: The Logging stack identifier for the OCI account. + :param pulumi.Input[_builtins.str] metric_stack_ocid: Metric stack OCID (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] name: Display name for the linked account. + :param pulumi.Input[_builtins.str] oci_region: OCI region for the linkage (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] user_vault_ocid: Vault secret OCID containing a user or auxiliary secret. + """ + pulumi.set(__self__, "compartment_ocid", compartment_ocid) + pulumi.set(__self__, "oci_client_id", oci_client_id) + pulumi.set(__self__, "oci_client_secret", oci_client_secret) + pulumi.set(__self__, "oci_domain_url", oci_domain_url) + pulumi.set(__self__, "oci_home_region", oci_home_region) + pulumi.set(__self__, "oci_svc_user_name", oci_svc_user_name) + pulumi.set(__self__, "tenant_id", tenant_id) + if account_id is not None: + pulumi.set(__self__, "account_id", account_id) + if ingest_vault_ocid is not None: + pulumi.set(__self__, "ingest_vault_ocid", ingest_vault_ocid) + if instrumentation_type is not None: + pulumi.set(__self__, "instrumentation_type", instrumentation_type) + if logging_stack_ocid is not None: + pulumi.set(__self__, "logging_stack_ocid", logging_stack_ocid) + if metric_stack_ocid is not None: + pulumi.set(__self__, "metric_stack_ocid", metric_stack_ocid) + if name is not None: + pulumi.set(__self__, "name", name) + if oci_region is not None: + pulumi.set(__self__, "oci_region", oci_region) + if user_vault_ocid is not None: + pulumi.set(__self__, "user_vault_ocid", user_vault_ocid) + + @_builtins.property + @pulumi.getter(name="compartmentOcid") + def compartment_ocid(self) -> pulumi.Input[_builtins.str]: + """ + OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + """ + return pulumi.get(self, "compartment_ocid") + + @compartment_ocid.setter + def compartment_ocid(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "compartment_ocid", value) + + @_builtins.property + @pulumi.getter(name="ociClientId") + def oci_client_id(self) -> pulumi.Input[_builtins.str]: + """ + OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + """ + return pulumi.get(self, "oci_client_id") + + @oci_client_id.setter + def oci_client_id(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "oci_client_id", value) + + @_builtins.property + @pulumi.getter(name="ociClientSecret") + def oci_client_secret(self) -> pulumi.Input[_builtins.str]: + """ + OAuth2 client secret. Not displayed in plans or state outputs. + """ + return pulumi.get(self, "oci_client_secret") + + @oci_client_secret.setter + def oci_client_secret(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "oci_client_secret", value) + + @_builtins.property + @pulumi.getter(name="ociDomainUrl") + def oci_domain_url(self) -> pulumi.Input[_builtins.str]: + """ + Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + """ + return pulumi.get(self, "oci_domain_url") + + @oci_domain_url.setter + def oci_domain_url(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "oci_domain_url", value) + + @_builtins.property + @pulumi.getter(name="ociHomeRegion") + def oci_home_region(self) -> pulumi.Input[_builtins.str]: + """ + Home region of the tenancy (e.g. `us-ashburn-1`). + """ + return pulumi.get(self, "oci_home_region") + + @oci_home_region.setter + def oci_home_region(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "oci_home_region", value) + + @_builtins.property + @pulumi.getter(name="ociSvcUserName") + def oci_svc_user_name(self) -> pulumi.Input[_builtins.str]: + """ + Service user name associated with the WIF configuration. + """ + return pulumi.get(self, "oci_svc_user_name") + + @oci_svc_user_name.setter + def oci_svc_user_name(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "oci_svc_user_name", value) + + @_builtins.property + @pulumi.getter(name="tenantId") + def tenant_id(self) -> pulumi.Input[_builtins.str]: + """ + OCI tenancy OCID (root tenancy). Changing forces a new linked account. + """ + return pulumi.get(self, "tenant_id") + + @tenant_id.setter + def tenant_id(self, value: pulumi.Input[_builtins.str]): + pulumi.set(self, "tenant_id", value) + + @_builtins.property + @pulumi.getter(name="accountId") + def account_id(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + """ + return pulumi.get(self, "account_id") + + @account_id.setter + def account_id(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "account_id", value) + + @_builtins.property + @pulumi.getter(name="ingestVaultOcid") + def ingest_vault_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Vault secret OCID containing an ingest secret. + """ + return pulumi.get(self, "ingest_vault_ocid") + + @ingest_vault_ocid.setter + def ingest_vault_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "ingest_vault_ocid", value) + + @_builtins.property + @pulumi.getter(name="instrumentationType") + def instrumentation_type(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + """ + return pulumi.get(self, "instrumentation_type") + + @instrumentation_type.setter + def instrumentation_type(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "instrumentation_type", value) + + @_builtins.property + @pulumi.getter(name="loggingStackOcid") + def logging_stack_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + The Logging stack identifier for the OCI account. + """ + return pulumi.get(self, "logging_stack_ocid") + + @logging_stack_ocid.setter + def logging_stack_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "logging_stack_ocid", value) + + @_builtins.property + @pulumi.getter(name="metricStackOcid") + def metric_stack_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Metric stack OCID (ignored on create, applied on update). + """ + return pulumi.get(self, "metric_stack_ocid") + + @metric_stack_ocid.setter + def metric_stack_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "metric_stack_ocid", value) + + @_builtins.property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Display name for the linked account. + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "name", value) + + @_builtins.property + @pulumi.getter(name="ociRegion") + def oci_region(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OCI region for the linkage (ignored on create, applied on update). + """ + return pulumi.get(self, "oci_region") + + @oci_region.setter + def oci_region(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_region", value) + + @_builtins.property + @pulumi.getter(name="userVaultOcid") + def user_vault_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Vault secret OCID containing a user or auxiliary secret. + """ + return pulumi.get(self, "user_vault_ocid") + + @user_vault_ocid.setter + def user_vault_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "user_vault_ocid", value) + + +@pulumi.input_type +class _OciLinkAccountState: + def __init__(__self__, *, + account_id: Optional[pulumi.Input[_builtins.str]] = None, + compartment_ocid: Optional[pulumi.Input[_builtins.str]] = None, + ingest_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + instrumentation_type: Optional[pulumi.Input[_builtins.str]] = None, + logging_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + metric_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + name: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_id: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_secret: Optional[pulumi.Input[_builtins.str]] = None, + oci_domain_url: Optional[pulumi.Input[_builtins.str]] = None, + oci_home_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_svc_user_name: Optional[pulumi.Input[_builtins.str]] = None, + tenant_id: Optional[pulumi.Input[_builtins.str]] = None, + user_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None): + """ + Input properties used for looking up and filtering OciLinkAccount resources. + :param pulumi.Input[_builtins.str] account_id: New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + :param pulumi.Input[_builtins.str] compartment_ocid: OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + :param pulumi.Input[_builtins.str] ingest_vault_ocid: Vault secret OCID containing an ingest secret. + :param pulumi.Input[_builtins.str] instrumentation_type: Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + :param pulumi.Input[_builtins.str] logging_stack_ocid: The Logging stack identifier for the OCI account. + :param pulumi.Input[_builtins.str] metric_stack_ocid: Metric stack OCID (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] name: Display name for the linked account. + :param pulumi.Input[_builtins.str] oci_client_id: OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + :param pulumi.Input[_builtins.str] oci_client_secret: OAuth2 client secret. Not displayed in plans or state outputs. + :param pulumi.Input[_builtins.str] oci_domain_url: Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + :param pulumi.Input[_builtins.str] oci_home_region: Home region of the tenancy (e.g. `us-ashburn-1`). + :param pulumi.Input[_builtins.str] oci_region: OCI region for the linkage (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] oci_svc_user_name: Service user name associated with the WIF configuration. + :param pulumi.Input[_builtins.str] tenant_id: OCI tenancy OCID (root tenancy). Changing forces a new linked account. + :param pulumi.Input[_builtins.str] user_vault_ocid: Vault secret OCID containing a user or auxiliary secret. + """ + if account_id is not None: + pulumi.set(__self__, "account_id", account_id) + if compartment_ocid is not None: + pulumi.set(__self__, "compartment_ocid", compartment_ocid) + if ingest_vault_ocid is not None: + pulumi.set(__self__, "ingest_vault_ocid", ingest_vault_ocid) + if instrumentation_type is not None: + pulumi.set(__self__, "instrumentation_type", instrumentation_type) + if logging_stack_ocid is not None: + pulumi.set(__self__, "logging_stack_ocid", logging_stack_ocid) + if metric_stack_ocid is not None: + pulumi.set(__self__, "metric_stack_ocid", metric_stack_ocid) + if name is not None: + pulumi.set(__self__, "name", name) + if oci_client_id is not None: + pulumi.set(__self__, "oci_client_id", oci_client_id) + if oci_client_secret is not None: + pulumi.set(__self__, "oci_client_secret", oci_client_secret) + if oci_domain_url is not None: + pulumi.set(__self__, "oci_domain_url", oci_domain_url) + if oci_home_region is not None: + pulumi.set(__self__, "oci_home_region", oci_home_region) + if oci_region is not None: + pulumi.set(__self__, "oci_region", oci_region) + if oci_svc_user_name is not None: + pulumi.set(__self__, "oci_svc_user_name", oci_svc_user_name) + if tenant_id is not None: + pulumi.set(__self__, "tenant_id", tenant_id) + if user_vault_ocid is not None: + pulumi.set(__self__, "user_vault_ocid", user_vault_ocid) + + @_builtins.property + @pulumi.getter(name="accountId") + def account_id(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + """ + return pulumi.get(self, "account_id") + + @account_id.setter + def account_id(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "account_id", value) + + @_builtins.property + @pulumi.getter(name="compartmentOcid") + def compartment_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + """ + return pulumi.get(self, "compartment_ocid") + + @compartment_ocid.setter + def compartment_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "compartment_ocid", value) + + @_builtins.property + @pulumi.getter(name="ingestVaultOcid") + def ingest_vault_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Vault secret OCID containing an ingest secret. + """ + return pulumi.get(self, "ingest_vault_ocid") + + @ingest_vault_ocid.setter + def ingest_vault_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "ingest_vault_ocid", value) + + @_builtins.property + @pulumi.getter(name="instrumentationType") + def instrumentation_type(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + """ + return pulumi.get(self, "instrumentation_type") + + @instrumentation_type.setter + def instrumentation_type(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "instrumentation_type", value) + + @_builtins.property + @pulumi.getter(name="loggingStackOcid") + def logging_stack_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + The Logging stack identifier for the OCI account. + """ + return pulumi.get(self, "logging_stack_ocid") + + @logging_stack_ocid.setter + def logging_stack_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "logging_stack_ocid", value) + + @_builtins.property + @pulumi.getter(name="metricStackOcid") + def metric_stack_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Metric stack OCID (ignored on create, applied on update). + """ + return pulumi.get(self, "metric_stack_ocid") + + @metric_stack_ocid.setter + def metric_stack_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "metric_stack_ocid", value) + + @_builtins.property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Display name for the linked account. + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "name", value) + + @_builtins.property + @pulumi.getter(name="ociClientId") + def oci_client_id(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + """ + return pulumi.get(self, "oci_client_id") + + @oci_client_id.setter + def oci_client_id(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_client_id", value) + + @_builtins.property + @pulumi.getter(name="ociClientSecret") + def oci_client_secret(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OAuth2 client secret. Not displayed in plans or state outputs. + """ + return pulumi.get(self, "oci_client_secret") + + @oci_client_secret.setter + def oci_client_secret(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_client_secret", value) + + @_builtins.property + @pulumi.getter(name="ociDomainUrl") + def oci_domain_url(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + """ + return pulumi.get(self, "oci_domain_url") + + @oci_domain_url.setter + def oci_domain_url(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_domain_url", value) + + @_builtins.property + @pulumi.getter(name="ociHomeRegion") + def oci_home_region(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Home region of the tenancy (e.g. `us-ashburn-1`). + """ + return pulumi.get(self, "oci_home_region") + + @oci_home_region.setter + def oci_home_region(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_home_region", value) + + @_builtins.property + @pulumi.getter(name="ociRegion") + def oci_region(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OCI region for the linkage (ignored on create, applied on update). + """ + return pulumi.get(self, "oci_region") + + @oci_region.setter + def oci_region(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_region", value) + + @_builtins.property + @pulumi.getter(name="ociSvcUserName") + def oci_svc_user_name(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Service user name associated with the WIF configuration. + """ + return pulumi.get(self, "oci_svc_user_name") + + @oci_svc_user_name.setter + def oci_svc_user_name(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "oci_svc_user_name", value) + + @_builtins.property + @pulumi.getter(name="tenantId") + def tenant_id(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + OCI tenancy OCID (root tenancy). Changing forces a new linked account. + """ + return pulumi.get(self, "tenant_id") + + @tenant_id.setter + def tenant_id(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "tenant_id", value) + + @_builtins.property + @pulumi.getter(name="userVaultOcid") + def user_vault_ocid(self) -> Optional[pulumi.Input[_builtins.str]]: + """ + Vault secret OCID containing a user or auxiliary secret. + """ + return pulumi.get(self, "user_vault_ocid") + + @user_vault_ocid.setter + def user_vault_ocid(self, value: Optional[pulumi.Input[_builtins.str]]): + pulumi.set(self, "user_vault_ocid", value) + + +@pulumi.type_token("newrelic:cloud/ociLinkAccount:OciLinkAccount") +class OciLinkAccount(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + account_id: Optional[pulumi.Input[_builtins.str]] = None, + compartment_ocid: Optional[pulumi.Input[_builtins.str]] = None, + ingest_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + instrumentation_type: Optional[pulumi.Input[_builtins.str]] = None, + logging_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + metric_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + name: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_id: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_secret: Optional[pulumi.Input[_builtins.str]] = None, + oci_domain_url: Optional[pulumi.Input[_builtins.str]] = None, + oci_home_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_svc_user_name: Optional[pulumi.Input[_builtins.str]] = None, + tenant_id: Optional[pulumi.Input[_builtins.str]] = None, + user_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + __props__=None): + """ + Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. + + This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. + + ## Prerequisites + + For the `cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. + + > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\\ + See Getting Started: New Relic provider guide + + If you encounter issues or bugs, please open an issue in the GitHub repository. + + ### Workload Identity Federation (WIF) Attributes + + The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `oci_client_id`, `oci_client_secret`, `oci_domain_url`, and `oci_svc_user_name`. + + To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: + + [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) + + WIF configuration steps: + 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. + 2. Generate / record the client ID (`oci_client_id`) and client secret (`oci_client_secret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingest_vault_ocid` / `user_vault_ocid` if desired). + 3. Use the Identity Domain base URL as `oci_domain_url` (format: `https://idcs-.identity.oraclecloud.com`). + 4. Provide / map a service user (or principal) used for workload identity federation as `oci_svc_user_name`. + 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. + + > TIP: Rotating the OAuth2 client secret only requires updating `oci_client_secret`; it does not force resource replacement. + + ## Example Usage + + Minimal example (required arguments for creation): + + ```python + import pulumi + import pulumi_newrelic as newrelic + + example = newrelic.cloud.OciLinkAccount("example", + account_id="1234567", + tenant_id="ocid1.tenancy.oc1..aaaaaaaaexample", + name="my-oci-link", + compartment_ocid="ocid1.compartment.oc1..bbbbbbbbexample", + oci_client_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + oci_client_secret=oci_client_secret, + oci_domain_url="https://idcs-1234567890abcdef.identity.oraclecloud.com", + oci_home_region="us-ashburn-1", + oci_svc_user_name="svc-newrelic-collector") + ``` + + Example including optional secret references and update-only fields: + + ```python + import pulumi + import pulumi_newrelic as newrelic + + full = newrelic.cloud.OciLinkAccount("full", + name="my-oci-link-full", + tenant_id="ocid1.tenancy.oc1..aaaaaaaaexample", + compartment_ocid="ocid1.compartment.oc1..bbbbbbbbexample", + oci_client_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + oci_client_secret=oci_client_secret, + oci_domain_url="https://idcs-1234567890abcdef.identity.oraclecloud.com", + oci_home_region="us-ashburn-1", + oci_svc_user_name="svc-newrelic-collector", + ingest_vault_ocid="ocid1.vaultsecret.oc1..ccccccccexample", + user_vault_ocid="ocid1.vaultsecret.oc1..ddddddddexample", + instrumentation_type="METRICS,LOGS", + oci_region="us-phoenix-1", + metric_stack_ocid="ocid1.stack.oc1..eeeeeeeeexample", + logging_stack_ocid="ocid1.stack.oc1..ffffffloggingstack") + ``` + + ## Import + + Linked OCI accounts can be imported using the `id`, e.g. + + bash + + ```sh + $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[_builtins.str] account_id: New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + :param pulumi.Input[_builtins.str] compartment_ocid: OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + :param pulumi.Input[_builtins.str] ingest_vault_ocid: Vault secret OCID containing an ingest secret. + :param pulumi.Input[_builtins.str] instrumentation_type: Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + :param pulumi.Input[_builtins.str] logging_stack_ocid: The Logging stack identifier for the OCI account. + :param pulumi.Input[_builtins.str] metric_stack_ocid: Metric stack OCID (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] name: Display name for the linked account. + :param pulumi.Input[_builtins.str] oci_client_id: OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + :param pulumi.Input[_builtins.str] oci_client_secret: OAuth2 client secret. Not displayed in plans or state outputs. + :param pulumi.Input[_builtins.str] oci_domain_url: Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + :param pulumi.Input[_builtins.str] oci_home_region: Home region of the tenancy (e.g. `us-ashburn-1`). + :param pulumi.Input[_builtins.str] oci_region: OCI region for the linkage (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] oci_svc_user_name: Service user name associated with the WIF configuration. + :param pulumi.Input[_builtins.str] tenant_id: OCI tenancy OCID (root tenancy). Changing forces a new linked account. + :param pulumi.Input[_builtins.str] user_vault_ocid: Vault secret OCID containing a user or auxiliary secret. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: OciLinkAccountArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Use this resource to link an Oracle Cloud Infrastructure (OCI) account to New Relic. + + This setup is used to create a provider account with OCI credentials, establishing a relationship between Oracle and New Relic. Additionally, as part of this integration, we store WIF (Workload Identity Federation) credentials which are further used for fetching data and validations, and vault OCIDs corresponding to the vault resource where the New Relic ingest and user keys are stored in the OCI console. + + ## Prerequisites + + For the `cloud.OciLinkAccount` resource to work properly, you need an OCI tenancy with IAM permissions to create and manage the identity artifacts (client/application, secrets, compartments, and service user) referenced below. OCI provides enterprise-grade cloud services across multiple global regions. + + > NOTE: Before using this resource, ensure the New Relic provider is configured with valid credentials.\\ + See Getting Started: New Relic provider guide + + If you encounter issues or bugs, please open an issue in the GitHub repository. + + ### Workload Identity Federation (WIF) Attributes + + The following arguments rely on an OCI Identity Domain OAuth2 client set up for workload identity federation (identity propagation): `oci_client_id`, `oci_client_secret`, `oci_domain_url`, and `oci_svc_user_name`. + + To create and retrieve these values, follow Oracle's guidance for configuring identity propagation / JWT token exchange: + + [Oracle documentation: Create an identity propagation trust (JWT token exchange)](https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/json_web_token_exchange.htm#jwt_token_exchange__create-identity-propagation-trust) + + WIF configuration steps: + 1. Create (or identify) an Identity Domain and register an OAuth2 confidential application (client) to represent New Relic ingestion. + 2. Generate / record the client ID (`oci_client_id`) and client secret (`oci_client_secret`). Store the secret securely (e.g., in OCI Vault; reference its OCID via `ingest_vault_ocid` / `user_vault_ocid` if desired). + 3. Use the Identity Domain base URL as `oci_domain_url` (format: `https://idcs-.identity.oraclecloud.com`). + 4. Provide / map a service user (or principal) used for workload identity federation as `oci_svc_user_name`. + 5. Ensure the client has the required scopes and the tenancy policies allow the token exchange. + + > TIP: Rotating the OAuth2 client secret only requires updating `oci_client_secret`; it does not force resource replacement. + + ## Example Usage + + Minimal example (required arguments for creation): + + ```python + import pulumi + import pulumi_newrelic as newrelic + + example = newrelic.cloud.OciLinkAccount("example", + account_id="1234567", + tenant_id="ocid1.tenancy.oc1..aaaaaaaaexample", + name="my-oci-link", + compartment_ocid="ocid1.compartment.oc1..bbbbbbbbexample", + oci_client_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + oci_client_secret=oci_client_secret, + oci_domain_url="https://idcs-1234567890abcdef.identity.oraclecloud.com", + oci_home_region="us-ashburn-1", + oci_svc_user_name="svc-newrelic-collector") + ``` + + Example including optional secret references and update-only fields: + + ```python + import pulumi + import pulumi_newrelic as newrelic + + full = newrelic.cloud.OciLinkAccount("full", + name="my-oci-link-full", + tenant_id="ocid1.tenancy.oc1..aaaaaaaaexample", + compartment_ocid="ocid1.compartment.oc1..bbbbbbbbexample", + oci_client_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + oci_client_secret=oci_client_secret, + oci_domain_url="https://idcs-1234567890abcdef.identity.oraclecloud.com", + oci_home_region="us-ashburn-1", + oci_svc_user_name="svc-newrelic-collector", + ingest_vault_ocid="ocid1.vaultsecret.oc1..ccccccccexample", + user_vault_ocid="ocid1.vaultsecret.oc1..ddddddddexample", + instrumentation_type="METRICS,LOGS", + oci_region="us-phoenix-1", + metric_stack_ocid="ocid1.stack.oc1..eeeeeeeeexample", + logging_stack_ocid="ocid1.stack.oc1..ffffffloggingstack") + ``` + + ## Import + + Linked OCI accounts can be imported using the `id`, e.g. + + bash + + ```sh + $ pulumi import newrelic:cloud/ociLinkAccount:OciLinkAccount foo + ``` + + :param str resource_name: The name of the resource. + :param OciLinkAccountArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(OciLinkAccountArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + account_id: Optional[pulumi.Input[_builtins.str]] = None, + compartment_ocid: Optional[pulumi.Input[_builtins.str]] = None, + ingest_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + instrumentation_type: Optional[pulumi.Input[_builtins.str]] = None, + logging_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + metric_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + name: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_id: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_secret: Optional[pulumi.Input[_builtins.str]] = None, + oci_domain_url: Optional[pulumi.Input[_builtins.str]] = None, + oci_home_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_svc_user_name: Optional[pulumi.Input[_builtins.str]] = None, + tenant_id: Optional[pulumi.Input[_builtins.str]] = None, + user_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = OciLinkAccountArgs.__new__(OciLinkAccountArgs) + + __props__.__dict__["account_id"] = account_id + if compartment_ocid is None and not opts.urn: + raise TypeError("Missing required property 'compartment_ocid'") + __props__.__dict__["compartment_ocid"] = compartment_ocid + __props__.__dict__["ingest_vault_ocid"] = ingest_vault_ocid + __props__.__dict__["instrumentation_type"] = instrumentation_type + __props__.__dict__["logging_stack_ocid"] = logging_stack_ocid + __props__.__dict__["metric_stack_ocid"] = metric_stack_ocid + __props__.__dict__["name"] = name + if oci_client_id is None and not opts.urn: + raise TypeError("Missing required property 'oci_client_id'") + __props__.__dict__["oci_client_id"] = oci_client_id + if oci_client_secret is None and not opts.urn: + raise TypeError("Missing required property 'oci_client_secret'") + __props__.__dict__["oci_client_secret"] = None if oci_client_secret is None else pulumi.Output.secret(oci_client_secret) + if oci_domain_url is None and not opts.urn: + raise TypeError("Missing required property 'oci_domain_url'") + __props__.__dict__["oci_domain_url"] = oci_domain_url + if oci_home_region is None and not opts.urn: + raise TypeError("Missing required property 'oci_home_region'") + __props__.__dict__["oci_home_region"] = oci_home_region + __props__.__dict__["oci_region"] = oci_region + if oci_svc_user_name is None and not opts.urn: + raise TypeError("Missing required property 'oci_svc_user_name'") + __props__.__dict__["oci_svc_user_name"] = oci_svc_user_name + if tenant_id is None and not opts.urn: + raise TypeError("Missing required property 'tenant_id'") + __props__.__dict__["tenant_id"] = tenant_id + __props__.__dict__["user_vault_ocid"] = user_vault_ocid + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["ociClientSecret"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) + super(OciLinkAccount, __self__).__init__( + 'newrelic:cloud/ociLinkAccount:OciLinkAccount', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + account_id: Optional[pulumi.Input[_builtins.str]] = None, + compartment_ocid: Optional[pulumi.Input[_builtins.str]] = None, + ingest_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None, + instrumentation_type: Optional[pulumi.Input[_builtins.str]] = None, + logging_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + metric_stack_ocid: Optional[pulumi.Input[_builtins.str]] = None, + name: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_id: Optional[pulumi.Input[_builtins.str]] = None, + oci_client_secret: Optional[pulumi.Input[_builtins.str]] = None, + oci_domain_url: Optional[pulumi.Input[_builtins.str]] = None, + oci_home_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_region: Optional[pulumi.Input[_builtins.str]] = None, + oci_svc_user_name: Optional[pulumi.Input[_builtins.str]] = None, + tenant_id: Optional[pulumi.Input[_builtins.str]] = None, + user_vault_ocid: Optional[pulumi.Input[_builtins.str]] = None) -> 'OciLinkAccount': + """ + Get an existing OciLinkAccount resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[_builtins.str] account_id: New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + :param pulumi.Input[_builtins.str] compartment_ocid: OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + :param pulumi.Input[_builtins.str] ingest_vault_ocid: Vault secret OCID containing an ingest secret. + :param pulumi.Input[_builtins.str] instrumentation_type: Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + :param pulumi.Input[_builtins.str] logging_stack_ocid: The Logging stack identifier for the OCI account. + :param pulumi.Input[_builtins.str] metric_stack_ocid: Metric stack OCID (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] name: Display name for the linked account. + :param pulumi.Input[_builtins.str] oci_client_id: OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + :param pulumi.Input[_builtins.str] oci_client_secret: OAuth2 client secret. Not displayed in plans or state outputs. + :param pulumi.Input[_builtins.str] oci_domain_url: Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + :param pulumi.Input[_builtins.str] oci_home_region: Home region of the tenancy (e.g. `us-ashburn-1`). + :param pulumi.Input[_builtins.str] oci_region: OCI region for the linkage (ignored on create, applied on update). + :param pulumi.Input[_builtins.str] oci_svc_user_name: Service user name associated with the WIF configuration. + :param pulumi.Input[_builtins.str] tenant_id: OCI tenancy OCID (root tenancy). Changing forces a new linked account. + :param pulumi.Input[_builtins.str] user_vault_ocid: Vault secret OCID containing a user or auxiliary secret. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _OciLinkAccountState.__new__(_OciLinkAccountState) + + __props__.__dict__["account_id"] = account_id + __props__.__dict__["compartment_ocid"] = compartment_ocid + __props__.__dict__["ingest_vault_ocid"] = ingest_vault_ocid + __props__.__dict__["instrumentation_type"] = instrumentation_type + __props__.__dict__["logging_stack_ocid"] = logging_stack_ocid + __props__.__dict__["metric_stack_ocid"] = metric_stack_ocid + __props__.__dict__["name"] = name + __props__.__dict__["oci_client_id"] = oci_client_id + __props__.__dict__["oci_client_secret"] = oci_client_secret + __props__.__dict__["oci_domain_url"] = oci_domain_url + __props__.__dict__["oci_home_region"] = oci_home_region + __props__.__dict__["oci_region"] = oci_region + __props__.__dict__["oci_svc_user_name"] = oci_svc_user_name + __props__.__dict__["tenant_id"] = tenant_id + __props__.__dict__["user_vault_ocid"] = user_vault_ocid + return OciLinkAccount(resource_name, opts=opts, __props__=__props__) + + @_builtins.property + @pulumi.getter(name="accountId") + def account_id(self) -> pulumi.Output[_builtins.str]: + """ + New Relic account to operate on. Overrides the provider-level `account_id`. If omitted, use the provider default or `NEW_RELIC_ACCOUNT_ID`. + """ + return pulumi.get(self, "account_id") + + @_builtins.property + @pulumi.getter(name="compartmentOcid") + def compartment_ocid(self) -> pulumi.Output[_builtins.str]: + """ + OCI compartment OCID representing (or containing) the monitored resources/newrelic compartment. + """ + return pulumi.get(self, "compartment_ocid") + + @_builtins.property + @pulumi.getter(name="ingestVaultOcid") + def ingest_vault_ocid(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + Vault secret OCID containing an ingest secret. + """ + return pulumi.get(self, "ingest_vault_ocid") + + @_builtins.property + @pulumi.getter(name="instrumentationType") + def instrumentation_type(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + Specifies the type of integration, such as metrics, logs, or a combination of logs and metrics (e.g., `METRICS`, `LOGS`, `METRICS,LOGS`). + """ + return pulumi.get(self, "instrumentation_type") + + @_builtins.property + @pulumi.getter(name="loggingStackOcid") + def logging_stack_ocid(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + The Logging stack identifier for the OCI account. + """ + return pulumi.get(self, "logging_stack_ocid") + + @_builtins.property + @pulumi.getter(name="metricStackOcid") + def metric_stack_ocid(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + Metric stack OCID (ignored on create, applied on update). + """ + return pulumi.get(self, "metric_stack_ocid") + + @_builtins.property + @pulumi.getter + def name(self) -> pulumi.Output[_builtins.str]: + """ + Display name for the linked account. + """ + return pulumi.get(self, "name") + + @_builtins.property + @pulumi.getter(name="ociClientId") + def oci_client_id(self) -> pulumi.Output[_builtins.str]: + """ + OCI Identity Domain (IDCS) OAuth2 client ID used for workload identity federation. + """ + return pulumi.get(self, "oci_client_id") + + @_builtins.property + @pulumi.getter(name="ociClientSecret") + def oci_client_secret(self) -> pulumi.Output[_builtins.str]: + """ + OAuth2 client secret. Not displayed in plans or state outputs. + """ + return pulumi.get(self, "oci_client_secret") + + @_builtins.property + @pulumi.getter(name="ociDomainUrl") + def oci_domain_url(self) -> pulumi.Output[_builtins.str]: + """ + Base URL of the OCI Identity Domain (e.g. `https://idcs-.identity.oraclecloud.com`). + """ + return pulumi.get(self, "oci_domain_url") + + @_builtins.property + @pulumi.getter(name="ociHomeRegion") + def oci_home_region(self) -> pulumi.Output[_builtins.str]: + """ + Home region of the tenancy (e.g. `us-ashburn-1`). + """ + return pulumi.get(self, "oci_home_region") + + @_builtins.property + @pulumi.getter(name="ociRegion") + def oci_region(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + OCI region for the linkage (ignored on create, applied on update). + """ + return pulumi.get(self, "oci_region") + + @_builtins.property + @pulumi.getter(name="ociSvcUserName") + def oci_svc_user_name(self) -> pulumi.Output[_builtins.str]: + """ + Service user name associated with the WIF configuration. + """ + return pulumi.get(self, "oci_svc_user_name") + + @_builtins.property + @pulumi.getter(name="tenantId") + def tenant_id(self) -> pulumi.Output[_builtins.str]: + """ + OCI tenancy OCID (root tenancy). Changing forces a new linked account. + """ + return pulumi.get(self, "tenant_id") + + @_builtins.property + @pulumi.getter(name="userVaultOcid") + def user_vault_ocid(self) -> pulumi.Output[Optional[_builtins.str]]: + """ + Vault secret OCID containing a user or auxiliary secret. + """ + return pulumi.get(self, "user_vault_ocid") + diff --git a/upstream b/upstream index 5ad12638..a425e3c2 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 5ad126389d6e8d608fdc98e5ecda604d818b34c3 +Subproject commit a425e3c2dec8bdc91b9387b350996f0634f0850f