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

Adding elastictranscoder preset support. #1255

Closed

Conversation

swhite-oreilly
Copy link
Contributor

This PR adds support for ElasticTranscoder Preset Support.

Testing

The following resources types were added to the config file:
"ElasticTranscoderPipeline"
"ElasticTranscoderPreset"

Resources were created for testing using this script:

# Generate a random string to use as a bucket name and classifier name suffix
RANDOM_STRING=$(openssl rand -hex 20)
# Generate a random string for shorter names
SHORT_RANDOM_STRING=$(openssl rand -hex 10)

# Get AWS account ID
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
echo "AWS Account ID: $AWS_ACCOUNT_ID"

# Set your preferred bucket names
INPUT_BUCKET="input-bucket-$SHORT_RANDOM_STRING"
OUTPUT_BUCKET="output-bucket-$SHORT_RANDOM_STRING"

# Create input bucket
aws s3api create-bucket --bucket $INPUT_BUCKET --no-cli-pager
echo "Input bucket created: s3://$INPUT_BUCKET"

# Create output bucket
aws s3api create-bucket --bucket $OUTPUT_BUCKET --no-cli-pager
echo "Output bucket created: s3://$OUTPUT_BUCKET"

# Define the role name
ROLE_NAME="elastictranscoder-access-role-$SHORT_RANDOM_STRING"

# Create the IAM role
aws iam create-role \
  --role-name $ROLE_NAME \
  --assume-role-policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"elastictranscoder.amazonaws.com"},"Action":"sts:AssumeRole"}]}'
echo "IAM role created: $ROLE_NAME"

# Attach the necessary policy to the role
aws iam attach-role-policy --role-name $ROLE_NAME --policy-arn arn:aws:iam::aws:policy/AmazonElasticTranscoder_FullAccess
echo "Policy attached to role"

# Create elastic transcoder pipeline
PIPELINE_RESPONSE=$(aws elastictranscoder create-pipeline \
  --name "my-et-pipeline" \
  --input-bucket "$INPUT_BUCKET" \
  --output-bucket "$OUTPUT_BUCKET" \
  --role "arn:aws:iam::$AWS_ACCOUNT_ID:role/$ROLE_NAME" \
  --output json)

# Extract the pipeline ID from the response
PIPELINE_ID=$(echo $PIPELINE_RESPONSE | jq -r '.Pipeline.Id')
echo "Pipeline ID: $PIPELINE_ID"

# Create an example elastic transcoder preset
PRESET_RESPONSE=$(aws elastictranscoder create-preset \
  --name "my-et-preset" \
  --description "Description of my preset" \
  --container "mp3" \
  --audio "Codec=mp3,SampleRate=44100,BitRate=64,Channels=2")

# Extract the preset ID from the response
PRESET_ID=$(echo $PRESET_RESPONSE | jq -r '.Preset.Id')
echo "Elastic transcoder preset created with ID: $PRESET_ID"

# Create an example elastic transcoder job
aws elastictranscoder create-job \
  --pipeline-id "$PIPELINE_ID" \
  --inputs "Key=files/MLKDreamSpeech.mp3" \
  --outputs "Key=output_file.json,PresetId=$PRESET_ID"
echo "Elastic transcoder job created"

# # List elastic transcoder pipelines
# aws elastictranscoder list-pipelines --no-cli-pager

# # List elastic transcoder presets
# aws elastictranscoder list-presets --no-cli-pager

# # List elastic transcoder jobs
# aws elastictranscoder list-jobs-by-pipeline --pipeline-id "$PIPELINE_ID" --no-cli-pager

This PR adds support for ElasticTranscoder Preset Support.
@swhite-oreilly swhite-oreilly requested a review from a team as a code owner August 7, 2024 15:31
@ekristen
Copy link
Collaborator

@swhite-oreilly this has been implemented via ekristen/aws-nuke#244 of what is now the active fork of aws-nuke.

This project has now been deprecated in favor of this fork. Sven kindly granted me access to directly answer and close pull requests and issues so that we can notify users if their issues have been addressed or not. Please see the welcome issue for more information.

@ekristen ekristen closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants