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

Configure Bedrock.InferenceProfile resource and add example #1641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

larhauga
Copy link

Description of your changes

This change implements the bedrock inference profile resource enabling the creation of application inference profiles.

Fixes #1589

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested with make run in eu-central-1 aws region.

For testing this resource you will need to enable the models in the AWS account in accordance with https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html

aws bedrock list-inference-profiles --type-equals APPLICATION --region eu-central-1
{
    "inferenceProfileSummaries": [
        {
            "inferenceProfileName": "llama-test-profile",
            "description": "Profile with tag for cost allocation tracking",
            "createdAt": "2025-01-16T08:58:00.978628+00:00",
            "updatedAt": "2025-01-16T08:58:00.978628+00:00",
            "inferenceProfileArn": "arn:aws:bedrock:eu-central-1:redacted:application-inference-profile/redacted",
            "models": [
                {
                    "modelArn": "arn:aws:bedrock:eu-central-1::foundation-model/meta.llama3-2-1b-instruct-v1:0"
                },
                {
                    "modelArn": "arn:aws:bedrock:eu-west-1::foundation-model/meta.llama3-2-1b-instruct-v1:0"
                },
                {
                    "modelArn": "arn:aws:bedrock:eu-west-3::foundation-model/meta.llama3-2-1b-instruct-v1:0"
                }
            ],
            "inferenceProfileId": "redacted",
            "status": "ACTIVE",
            "type": "APPLICATION"
        }
    ]
}

Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
@turkenf
Copy link
Collaborator

turkenf commented Jan 17, 2025

/test-examples="examples/bedrock/v1beta1/inferenceprofile.yaml"

@larhauga
Copy link
Author

@turkenf anything I can do to help with the failed build?

@turkenf
Copy link
Collaborator

turkenf commented Jan 24, 2025

Hi @larhauga,

We are grateful for your first PR, thank you for your efforts and patience here 🙌

@turkenf anything I can do to help with the failed build?

From what I can see in the uptest logs and as you mentioned in your PR description, the problem seems to be an permission error. There is nothing you can do at the moment. When I get the chance, I will define the relevant policy for the test account and review your PR.

    logger.go:42: 17:58:32 | case/0-apply |     - lastTransitionTime: "2025-01-17T17:57:48Z"
    logger.go:42: 17:58:32 | case/0-apply |       message: 'async create failed: resource creation call returned error diags:
    logger.go:42: 17:58:32 | case/0-apply |         creating Amazon Bedrock Inference Profile ("llama-app"): operation error Bedrock:
    logger.go:42: 17:58:32 | case/0-apply |         CreateInferenceProfile, https response error StatusCode: 403, RequestID: 4ba17e39-0ad5-442f-95e9-24ec9459e598,
    logger.go:42: 17:58:32 | case/0-apply |         AccessDeniedException: User: arn:aws:iam::153891904029:user/official-provider-testing
    logger.go:42: 17:58:32 | case/0-apply |         is not authorized to perform: bedrock:CreateInferenceProfile on resource:
    logger.go:42: 17:58:32 | case/0-apply |         arn:aws:bedrock:eu-central-1:964273356747:inference-profile/eu.meta.llama3-2-1b-instruct-v1:0
    logger.go:42: 17:58:32 | case/0-apply |         because no resource-based policy allows the bedrock:CreateInferenceProfile
    logger.go:42: 17:58:32 | case/0-apply |         action: operation error Bedrock: CreateInferenceProfile, https response error
    logger.go:42: 17:58:32 | case/0-apply |         StatusCode: 403, RequestID: 4ba17e39-0ad5-442f-95e9-24ec9459e598, AccessDeniedException:
    logger.go:42: 17:58:32 | case/0-apply |         User: arn:aws:iam::153891904029:user/official-provider-testing is not authorized
    logger.go:42: 17:58:32 | case/0-apply |         to perform: bedrock:CreateInferenceProfile on resource: arn:aws:bedrock:eu-central-1:964273356747:inference-profile/eu.meta.llama3-2-1b-instruct-v1:0
    logger.go:42: 17:58:32 | case/0-apply |         because no resource-based policy allows the bedrock:CreateInferenceProfile
    logger.go:42: 17:58:32 | case/0-apply |         action'

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.

Request for aws_bedrock_inference_profile resource
2 participants