Proceed with the following steps to allow CodeBuild to upload build artifacts to your Amazon S3 bucket:
- Log in to AWS and open IAM console from https://console.aws.amazon.com/iam/.
- Select Roles and open the role that was generated for that project. Typically, it should look like code-build-project-name-service-role.
- Under the Permissions tab, select Add inline policy.
- In service, select Choose a service.
- In Select a service, choose S3.
- In Actions, select actions.
- Under Access level groups, expand write, and then select PutObject.
- Select Resources and select any checkbox.
- Select Review policy.
- Add the name and then select Create policy.