romenigld

romenigld

Hello guys I am doing the course Liveview course of the pragprog and I would like to know how to put the Amazon AWS S3 bucket to be public.

I created the bucket and put the ‘CORS’ on the ‘Permissions’.
But I can’t put this new bucket on public.
Someone could help me with this please?

My application is complaining for this:

[error] GenServer #PID<0.713.0> terminating
** (FunctionClauseError) no function clause matching in RldLiveViewStudioWeb.DesksLive.error_to_string/1
    (rld_live_view_studio 0.1.0) lib/rld_live_view_studio_web/live/desks_live.ex:74: RldLiveViewStudioWeb.DesksLive.error_to_string(:external_client_failure)
    (rld_live_view_studio 0.1.0) lib/rld_live_view_studio_web/live/desks_live.html.heex:49: anonymous fn/3 in RldLiveViewStudioWeb.DesksLive.render/1
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:398: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:544: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
    (elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:396: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:571: anonymous fn/3 in Phoenix.LiveView.Diff.traverse_comprehension/5
    (elixir 1.14.3) lib/enum.ex:1780: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:484: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:571: anonymous fn/3 in Phoenix.LiveView.Diff.traverse_comprehension/5
    (elixir 1.14.3) lib/enum.ex:1780: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (elixir 1.14.3) lib/enum.ex:1780: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (elixir 1.14.3) lib/enum.ex:1780: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:450: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:544: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
    (elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:373: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:544: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
    (elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:373: Phoenix.LiveView.Diff.traverse/7
Last message: %Phoenix.Socket.Message{topic: "lv:phx-F5alJ2XuJWOBaQGj", event: "progress", payload: %{"entry_ref" => "0", "event" => nil, "progress" => %{"error" => "failed"}, "ref" => "phx-F5alJ5A-iS4F6QMC"}, ref: "11", join_ref: "4"}
State: %{components: {%{}, %{}, 1}, join_ref: "4", serializer: Phoenix.Socket.V2.JSONSerializer, socket: #Phoenix.LiveView.Socket<id: "phx-F5alJ2XuJWOBaQGj", endpoint: RldLiveViewStudioWeb.Endpoint, view: RldLiveViewStudioWeb.DesksLive, parent_pid: nil, root_pid: #PID<0.713.0>, router: RldLiveViewStudioWeb.Router, assigns: %{__changed__: %{}, flash: %{}, form: %Phoenix.HTML.Form{source: #Ecto.Changeset<action: :validate, changes: %{name: "Wally"}, errors: [], data: #RldLiveViewStudio.Desks.Desk<>, valid?: true>, impl: Phoenix.HTML.FormData.Ecto.Changeset, id: "desk", name: "desk", data: %RldLiveViewStudio.Desks.Desk{__meta__: #Ecto.Schema.Metadata<:built, "desks">, id: nil, name: nil, photo_locations: [], inserted_at: nil, updated_at: nil}, hidden: [], params: %{"name" => "Wally"}, errors: [], options: [method: "post"], index: nil, action: nil}, live_action: nil, streams: %{__changed__: MapSet.new([]), desks: %Phoenix.LiveView.LiveStream{name: :desks, dom_id: #Function<3.113057034/1 in Phoenix.LiveView.LiveStream.new/3>, inserts: [], deletes: []}}, uploads: %{__phoenix_refs_to_names__: %{"phx-F5alJ5A-iS4F6QMC" => :photos}, photos: #Phoenix.LiveView.UploadConfig<name: :photos, max_entries: 3, max_file_size: 10000000, entries: [%Phoenix.LiveView.UploadEntry{progress: 0, preflighted?: true, upload_config: :photos, upload_ref: "phx-F5alJ5A-iS4F6QMC", ref: "0", uuid: "82a6de32-406d-49cd-97e7-fc524021a170", valid?: true, done?: false, cancelled?: false, client_name: "bingo01.jpg", client_relative_path: "", client_size: 47293, client_type: "image/jpeg", client_last_modified: 1679089898580}], accept: ".png,.jpeg,.jpg", ref: "phx-F5alJ5A-iS4F6QMC", errors: [], auto_upload?: false, progress_event: nil, ...>}}, transport_pid: #PID<0.707.0>, ...>, topic: "lv:phx-F5alJ2XuJWOBaQGj", upload_names: %{photos: {"phx-F5alJ5A-iS4F6QMC", nil}}, upload_pids: %{}}

But I changed the name of the @s3_bucketto use an old bucket I have then it work’s!
But I would like to know how to deal with a new bucket.
for others apps.

Showing Posts 1 to 3

PrincetonPoh

PrincetonPoh

Are you trying to make your AWS bucket public? If yes, you can simply change it here with the edit button.

romenigld

romenigld OP

I tried there before but it was unsuccessfully.
Which options you put?

PrincetonPoh

PrincetonPoh

After setting it to public, you can update the bucket policy to allow read and write access.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Allow",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<user_iam_id>:user/<bucketname>"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::<bucketname>/*",
                "arn:aws:s3:::<bucketname>"
            ]
        },
        {
            "Sid": "AllowAllRead",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::<bucketname>/*",
                "arn:aws:s3:::<bucketname>"
            ]
        }
    ]
}
— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews