Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medialive getInput function #4091

Closed
williamsbdev opened this issue Jun 20, 2024 · 5 comments · Fixed by #4160
Closed

Medialive getInput function #4091

williamsbdev opened this issue Jun 20, 2024 · 5 comments · Fixed by #4160
Assignees
Labels
awaiting/bridge The issue cannot be resolved without action in pulumi-terraform-bridge. impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@williamsbdev
Copy link

Describe what happened

We are getting an "encoder" error when trying to do a lookup of the AWS Medialive Input when trying to lookup using the getInput function (we're using the getInputOutput).

Sample program

const name = 'example';

  const inputSecurityGroup = new aws.medialive.InputSecurityGroup(name, {
    whitelistRules: [
      {
        cidr: '1.1.1.1/32',
      },
    ],
  });

  const input = new aws.medialive.Input(name, {
    name,
    type: 'RTMP_PUSH',
    destinations: [
      {
        streamName: `live/${name}`,
      },
      {
        streamName: `live/${name}-backup`,
      },
    ],
    inputSecurityGroups: [inputSecurityGroup.id],
  });

  const medialiveInputOutput = aws.medialive.getInputOutput({
    id: input.id,
  });

Log output

pulumi up --stack brandon
Previewing update (brandon):

     Type                    Name             Plan       Info
     pulumi:pulumi:Stack     brandon-brandon             1 error
 ~   └─ aws:medialive:Input  trs              update     [diff: -vpc~vpc]

Diagnostics:
  pulumi:pulumi:Stack (brandon-brandon):
    error: Error: invocation of aws:medialive/getInput:getInput returned an error: cannot derive an encoder for data source "aws_medialive_input": Cannot derive an encoder for property "destinations": issue deriving an object encoder: Cannot derive an encoder for property "vpc": when deriving converters for an element of a collection: LookupSchemaPath failed at walk.NewSchemaPath(): walk.ElementStep{} is not applicable
        at Object.callback (/Users/brandon.williams/Projects/brandon/node_modules/@pulumi/aws/node_modules/@pulumi/runtime/invoke.ts:172:37)
        at Object.onReceiveStatus (/Users/brandon.williams/Projects/brandon/node_modules/@grpc/grpc-js/src/client.ts:360:26)
        at Object.onReceiveStatus (/Users/brandon.williams/Projects/brandon/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
        at Object.onReceiveStatus (/Users/brandon.williams/Projects/brandon/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
        at /Users/brandon.williams/Projects/brandon/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
        at processTicksAndRejections (node:internal/process/task_queues:77:11)

Affected Resource(s)

The getInput function for the Medialive Input.

Output of pulumi about

CLI
Version 3.111.0
Go Version go1.22.1
Go Compiler gc

Plugins
NAME VERSION
aws 6.41.0
aws 5.43.0
dynatrace 0.1.0
nodejs unknown

Host
OS darwin
Version 14.4.1
Arch arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v21.6.1'

Current Stack: brandon

TYPE URN
pulumi:pulumi:Stack urn:pulumi:brandon::brandon::pulumi:pulumi:Stack::brandon-brandon
pulumi:providers:aws urn:pulumi:brandon::brandon::pulumi:providers:aws::default_6_41_0
aws:medialive/inputSecurityGroup:InputSecurityGroup urn:pulumi:brandon::brandon::aws:medialive/inputSecurityGroup:InputSecurityGroup::example
aws:medialive/input:Input urn:pulumi:brandon::brandon::aws:medialive/input:Input::example

Found no pending operations associated with brandon

Backend
Name mm-williamsb2
URL s3://pulumi-state-1234
User brandon.williams
Organizations
Token type personal

Dependencies:
NAME VERSION
@pulumi/aws 6.41.0
@pulumi/pulumi 3.93.0
rs-accounts 0.1.3
@types/jest 29.5.8
@types/node 20.9.0

Additional context

I was able to produce the expected result using Terraform:

Sample program:

terraform {
  backend "s3" {
    bucket = "pulumi-state-1234"
    key    = "app-state"
    region = "us-east-1"
  }
}

resource "aws_medialive_input_security_group" "example" {
  whitelist_rules {
    cidr = "10.0.0.8/32"
  }
}

resource "aws_medialive_input" "example" {
  name                  = "example-input"
  input_security_groups = [aws_medialive_input_security_group.example.id]
  type                  = "RTMP_PUSH"

  destinations {
    stream_name = "main"
  }
  destinations {
    stream_name = "backup"
  }

  tags = {
    ENVIRONMENT = "prod"
  }
}

data "aws_medialive_input" "example" {
  id = aws_medialive_input.example.id
}

output "destinations" {
  value = data.aws_medialive_input.example.destinations
}

Log output:

terraform apply
aws_medialive_input_security_group.example: Refreshing state... [id=5614083]
aws_medialive_input.example: Refreshing state... [id=9913515]
data.aws_medialive_input.example: Reading...
data.aws_medialive_input.example: Read complete after 0s [id=9913515]

Changes to Outputs:
  + destinations = [
      + {
          + ip   = "18.210.155.34"
          + port = "1935"
          + url  = "rtmp://18.210.155.34:1935/main"
          + vpc  = null
        },
      + {
          + ip   = "100.29.92.85"
          + port = "1935"
          + url  = "rtmp://100.29.92.85:1935/backup"
          + vpc  = null
        },
    ]

You can apply this plan to save these new output values to the Terraform state, without changing any real
infrastructure.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes


Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

destinations = tolist([
  {
    "ip" = "18.210.155.34"
    "port" = "1935"
    "url" = "rtmp://18.210.155.34:1935/main"
    "vpc" = tolist(null) /* of object */
  },
  {
    "ip" = "100.29.92.85"
    "port" = "1935"
    "url" = "rtmp://100.29.92.85:1935/backup"
    "vpc" = tolist(null) /* of object */
  },
])

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@williamsbdev williamsbdev added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 20, 2024
@flostadler flostadler self-assigned this Jun 21, 2024
@flostadler flostadler removed the needs-triage Needs attention from the triage team label Jun 21, 2024
@flostadler
Copy link
Contributor

Hey @williamsbdev, thanks for reporting this issue. We'll take a look, definitely looks like a bug

@flostadler
Copy link
Contributor

Thanks for the example! I was able to reproduce this and pin-point it to the following issue: pulumi/pulumi-terraform-bridge#2020

Sorry that you're running into this, I'll work with the team to get this fix prioritized

@flostadler flostadler added awaiting/bridge The issue cannot be resolved without action in pulumi-terraform-bridge. impact/usability Something that impacts users' ability to use the product easily and intuitively labels Jun 21, 2024
@a1flecke
Copy link

Thanks for the example! I was able to reproduce this and pin-point it to the following issue: pulumi/pulumi-terraform-bridge#2020

Sorry that you're running into this, I'll work with the team to get this fix prioritized

Looking forward to this bug fix. Thanks for jumping on it

@flostadler flostadler removed their assignment Jun 24, 2024
@guineveresaenger guineveresaenger self-assigned this Jun 28, 2024
@guineveresaenger guineveresaenger added the resolution/fixed This issue was fixed label Jun 28, 2024
@guineveresaenger
Copy link
Contributor

Hi folks! Once the changes from pulumi/pulumi-terraform-bridge#2142 are applied to AWS, you should no longer see this issue - and the registry will show the relevant docs for this type as well.

Please do re-open this issue if we missed an edge case.

@t0yv0 t0yv0 reopened this Jul 1, 2024
pulumi-bot added a commit that referenced this issue Jul 3, 2024
This PR was generated via `$ upgrade-provider pulumi/pulumi-aws
--kind=bridge --pr-reviewers=guineveresaenger`.

Fixes #4091
Fixes #4137

---

- Upgrading pulumi-terraform-bridge from v3.85.0 to v3.86.0.
- Upgrading pulumi-terraform-bridge/pf from v0.38.0 to v0.39.0.
@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #4160 and shipped in release v6.43.0.

corymhall added a commit that referenced this issue Jul 11, 2024
# This is the 1st commit message:

Fix import resources with provider default tags

We have special logic around applying default provider tags to
resources. This logic only applied to the `Check` call which means it
was not applied when you were importing resources. This PR extends that
logic to also run during the `Read` call.

fix #4030, fix 4080

# This is the commit message #2:

skip test

# This is the commit message #3:

fixing test

# This is the commit message #4:

Adding more tests

# This is the commit message #5:

Upgrade pulumi-terraform-bridge to v3.86.0 (#4160)

This PR was generated via `$ upgrade-provider pulumi/pulumi-aws
--kind=bridge --pr-reviewers=guineveresaenger`.

Fixes #4091
Fixes #4137

---

- Upgrading pulumi-terraform-bridge from v3.85.0 to v3.86.0.
- Upgrading pulumi-terraform-bridge/pf from v0.38.0 to v0.39.0.
# This is the commit message #6:

chore: run upstream provider-lint (#4120)

This adds a step for running the upstream `provider-lint` make target.

As part of this I had to fix some of the patches which violated some
lint rules.

**0009-Add-ECR-credentials_data_source.patch**
- `ForceNew` does not apply to data sources

**0032-DisableTagSchemaCheck-for-PF-provider.patch**
- Schema have to have a `Type`
- Also needed to add a ignore for `S013` which forces `Computed`,
  `Optional` or `Required` to be set. Looks like it can't recognize the
  `tagsComputed` var

**0034-Fail-fast-when-PF-resources-are-dropped.patch**
- Added a lint ignore for a rule which doesn't allow panics

**0050-Normalize-retentionDays-in-aws_controltower_landing_.patch**
- This test doesn't actually need a region or partition so replacing
  with a placeholder

closes #4110
# This is the commit message #7:

fix: CVE-2024-24791 (#4175)

Fixes #4163

Upgrades minimally required Go versions to those unaffected by
CVE-2024-24791.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting/bridge The issue cannot be resolved without action in pulumi-terraform-bridge. impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants