> **Experimental**
>
> `@aws-cdk/aws-medialive-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# InputSource

A source for a pull-type input.

Use the static factory methods to create.

Obtainable from: InputSource.fromBucket, InputSource.url
Used as argument in: [InputConfiguration.mp4File](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.InputConfiguration.html#mp4file), [InputConfiguration.rtmpPull](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.InputConfiguration.html#rtmppull), InputConfiguration.tsFile, InputConfiguration.urlPull

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/input.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-medialive-alpha/lib/input.ts#L180)

## Example

TypeScript:

```ts
declare const stack: Stack;
declare const bucket: s3.IBucket;

new medialive.Input(stack, 'FileInput', {
  inputName: 'mp4-file',
  input: medialive.InputConfiguration.mp4File([
    medialive.InputSource.fromBucket(bucket, 'media/input.mp4'),
  ]),
});
```

Python:

```python
# stack: Stack
# bucket: s3.IBucket

medialive.Input(stack, "FileInput",
    input_name="mp4-file",
    input=medialive.InputConfiguration.mp4_file([
        medialive.InputSource.from_bucket(bucket, "media/input.mp4")
    ])
)
```

Java:

```java
Stack stack;
IBucket bucket;

Input.Builder.create(stack, "FileInput")
        .inputName("mp4-file")
        .input(InputConfiguration.mp4File(List.of(InputSource.fromBucket(bucket, "media/input.mp4"))))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
Stack stack;
IBucket bucket;

new Input(stack, "FileInput", new InputProps {
    InputName = "mp4-file",
    Input = InputConfiguration.Mp4File(new [] { InputSource.FromBucket(bucket, "media/input.mp4") })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
var stack Stack
var bucket IBucket

medialive.NewInput(stack, jsii.String("FileInput"), &InputProps{
	InputName: jsii.String("mp4-file"),
	Input: medialive.InputConfiguration_Mp4File([]InputSource{
		medialive.InputSource_FromBucket(bucket, jsii.String("media/input.mp4")),
	}),
})
```

## Initializer

TypeScript:

```ts
new InputSource()
```

Python:

```python
InputSource()
```

Java:

```java
new InputSource()
```

C# / .NET:

```csharp
new InputSource()
```

Golang:

```go
NewInputSource()
```

## Methods

- `fromBucket(bucket: IBucket, key: string): InputSource // chainable` (static) — Create a source from an S3 bucket.

  Automatically grants read access
  to the channel's role.

  **Parameters**

  - `bucket` — The S3 bucket containing the source file.
  - `key` — The object key within the bucket (e.g. 'videos/intro.mp4').

- `url(url: string, options?: InputSourceOptions): InputSource // chainable` (static) — Create a source from a URL.

  **Parameters**

  - `url` — The URL where MediaLive pulls the source content from.
  - `options` — Optional credentials.
